* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0f1117;
  --panel: #171a23;
  --panel2: #1e2230;
  --border: #262c3a;
  --fg: #e6e9f0;
  --muted: #8a93a6;
  --accent: #3b82f6;
  --accent2: #2563eb;
  --green: #22c55e;
  --red: #ef4444;
}
html, body { min-height: 100%; }
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg); color: var(--fg);
  display: flex; flex-direction: column;
}

header.topnav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px; border-bottom: 1px solid var(--border); background: var(--panel);
  position: relative; z-index: 2;
}
header.topnav .brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; }
header.topnav nav { display: flex; gap: 10px; align-items: center; }

.logo-mark {
  display: inline-block; width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 2px 0 #1e40af, 0 5px 10px -2px rgba(59,130,246,.55);
  transform: rotate(45deg);
}

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

.btn {
  display: inline-block; background: var(--panel2); color: var(--fg); border: 1px solid var(--border);
  padding: 10px 18px; border-radius: 8px; cursor: pointer; font-size: 14px;
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 6px 14px -8px rgba(0,0,0,.6);
  transform: translateY(0);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}
.btn:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 12px 22px -10px rgba(0,0,0,.65); }
.btn:active { transform: translateY(0); box-shadow: 0 2px 6px -2px rgba(0,0,0,.5); }
.btn.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent2)); border-color: var(--accent2); color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 12px 26px -10px rgba(59,130,246,.65);
}
.btn.primary:hover { box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 16px 32px -10px rgba(59,130,246,.75); }

main { flex: 1; width: 100%; }

.hero-3d {
  position: relative; overflow: hidden;
  padding: 100px 24px 60px;
}
.hero-grid-floor {
  position: absolute; left: -20%; right: -20%; bottom: 0; height: 420px;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 46px 46px;
  transform: perspective(600px) rotateX(62deg);
  transform-origin: bottom;
  opacity: .4;
  -webkit-mask-image: linear-gradient(to top, black, transparent 75%);
          mask-image: linear-gradient(to top, black, transparent 75%);
  pointer-events: none;
}
.hero-glow {
  position: absolute; top: -220px; left: 50%; transform: translateX(-50%);
  width: 680px; height: 680px; border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.32), transparent 65%);
  pointer-events: none;
}

.hero {
  position: relative; z-index: 1;
  max-width: 720px; margin: 0 auto; text-align: center;
}
.hero h1 { display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 42px; margin-bottom: 12px; }
.hero p { color: var(--muted); font-size: 16px; margin-bottom: 32px; line-height: 1.6; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .hint { margin-top: 14px; font-size: 12px; color: var(--muted); }

.hero-mockup-wrap {
  position: relative; z-index: 1;
  margin: 70px auto 0; perspective: 2000px;
  width: 300px;
  animation: mockup-float 6s ease-in-out infinite;
}
@keyframes mockup-float {
  0%, 100% { transform: translateY(0) rotateX(6deg) rotateY(-9deg); }
  50% { transform: translateY(-16px) rotateX(6deg) rotateY(-9deg); }
}

/* Phone frame: sells "runs on a real phone-like feed" better than an abstract browser card */
.phone-frame {
  position: relative; width: 300px; height: 612px; margin: 0 auto;
  border-radius: 46px; padding: 14px;
  transform-style: preserve-3d;
  background: linear-gradient(155deg, #30364a, #0e1017);
  box-shadow:
    0 60px 100px -24px rgba(0,0,0,.7),
    -26px 46px 80px -34px rgba(59,130,246,.35),
    inset 0 0 0 2px rgba(255,255,255,.05);
}
.phone-frame::before {
  content: ''; position: absolute; right: -3px; top: 130px; width: 3px; height: 64px;
  background: #0a0b10; border-radius: 2px 0 0 2px;
}
.phone-frame::after {
  content: ''; position: absolute; left: -3px; top: 96px; width: 3px; height: 40px;
  background: #0a0b10; border-radius: 0 2px 2px 0;
}
.phone-notch {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 92px; height: 22px; background: #0e1017; border-radius: 0 0 16px 16px; z-index: 4;
}
.phone-notch::after {
  content: ''; position: absolute; right: 15px; top: 7px; width: 8px; height: 8px; border-radius: 50%;
  background: #232735; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.08);
}
.phone-screen {
  position: relative; width: 100%; height: 100%; border-radius: 34px; overflow: hidden;
  background: #e9ebef; display: flex; flex-direction: column;
}
.phone-statusbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 22px 6px; font: 600 12px system-ui, sans-serif; color: #1c1e21; flex-shrink: 0;
}
.phone-statusbar .ps-icons { letter-spacing: 1px; font-size: 10px; }

.fb-feed {
  position: relative; flex: 1; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 4%, black 94%, transparent);
          mask-image: linear-gradient(to bottom, transparent, black 4%, black 94%, transparent);
}
.fb-feed-track {
  display: flex; flex-direction: column; gap: 8px;
  animation: feed-scroll 18s linear infinite;
}
@keyframes feed-scroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}
.fb-post { background: #fff; padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.fb-post-head { display: flex; align-items: center; gap: 9px; }
.fb-avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.fb-who { flex: 1; min-width: 0; }
.fb-name { font: 600 13px system-ui, sans-serif; color: #1c1e21; }
.fb-meta { font-size: 11px; color: #65676b; }
.fb-caption { font-size: 12.5px; color: #1c1e21; line-height: 1.4; }
.fb-photo {
  height: 130px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent2), #7c3aed);
}

.fb-video { position: relative; height: 190px; border-radius: 8px; overflow: hidden; background: #10121a; }
.fb-video-motion {
  position: absolute; inset: -30%; opacity: .8;
  background:
    radial-gradient(circle at 30% 30%, rgba(59,130,246,.55), transparent 55%),
    radial-gradient(circle at 70% 65%, rgba(124,58,237,.5), transparent 55%),
    radial-gradient(circle at 50% 90%, rgba(34,197,94,.35), transparent 50%);
  filter: blur(6px);
  animation: video-motion 7s ease-in-out infinite;
}
@keyframes video-motion {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(4%, -3%) scale(1.08); }
  66% { transform: translate(-3%, 4%) scale(1.05); }
}
.fb-video-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.18);
  color: #fff; font-size: 16px; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(2px); animation: video-play-pulse 3.5s ease-in-out infinite;
}
@keyframes video-play-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.fb-video-bar {
  position: absolute; left: 10px; right: 10px; bottom: 10px; height: 3px; border-radius: 2px;
  background: rgba(255,255,255,.25); overflow: hidden;
}
.fb-video-fill {
  height: 100%; width: 0%; background: #fff; border-radius: 2px;
  animation: video-progress 3.5s linear infinite;
}
@keyframes video-progress { 0% { width: 0%; } 100% { width: 100%; } }
.fb-video-time {
  position: absolute; right: 10px; top: 8px; font-size: 10px; color: #fff;
  background: rgba(0,0,0,.4); padding: 1px 6px; border-radius: 4px;
}

.fb-actions { display: flex; align-items: center; gap: 16px; font: 600 11.5px system-ui, sans-serif; color: #65676b; }
.fb-actions .like-icon { display: inline-block; margin-right: 3px; filter: grayscale(1); opacity: .6; transform: scale(1); animation: like-pulse 3.6s ease-in-out infinite; }
@keyframes like-pulse {
  0%, 60%, 100% { filter: grayscale(1); opacity: .6; transform: scale(1); }
  70% { filter: grayscale(0); opacity: 1; transform: scale(1.35); }
  82% { filter: grayscale(0); opacity: 1; transform: scale(1); }
}

.mockup-addfriend {
  position: relative; font-size: 11px; padding: 4px 10px; border-radius: 6px; white-space: nowrap;
  border: 1px solid var(--accent); color: var(--accent); background: transparent; overflow: hidden;
  margin-left: auto; flex-shrink: 0;
}
.mockup-addfriend .af-default, .mockup-addfriend .af-done { animation-duration: 4s; animation-iteration-count: infinite; animation-timing-function: ease-in-out; }
.mockup-addfriend .af-default { animation-name: af-default-fade; }
.mockup-addfriend .af-done {
  position: absolute; inset: -1px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; background: rgba(34,197,94,.15); color: var(--green); opacity: 0;
  animation-name: af-done-fade;
}
@keyframes af-default-fade { 0%, 55%, 100% { opacity: 1; } 65%, 90% { opacity: 0; } }
@keyframes af-done-fade { 0%, 55%, 100% { opacity: 0; } 65%, 90% { opacity: 1; } }

.fb-post:nth-child(3n+1) .like-icon { animation-delay: 0s; }
.fb-post:nth-child(3n+2) .like-icon { animation-delay: 1.1s; }
.fb-post:nth-child(3n+3) .like-icon { animation-delay: 2.2s; }
.fb-post:nth-child(3n+1) .af-default, .fb-post:nth-child(3n+1) .af-done { animation-delay: .3s; }
.fb-post:nth-child(3n+2) .af-default, .fb-post:nth-child(3n+2) .af-done { animation-delay: 1.6s; }
.fb-post:nth-child(3n+3) .af-default, .fb-post:nth-child(3n+3) .af-done { animation-delay: 2.9s; }

/* Fake automation cursor: clicks around the feed on a loop */
.mockup-cursor {
  position: absolute; width: 15px; height: 15px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 3px rgba(59,130,246,.4), 0 2px 8px rgba(0,0,0,.5); z-index: 5;
  animation: cursor-move 7s ease-in-out infinite;
}
.cursor-ring {
  position: absolute; inset: -9px; border: 2px solid var(--accent); border-radius: 50%; opacity: 0;
  animation: cursor-click 7s ease-in-out infinite;
}
@keyframes cursor-move {
  0%, 15%   { top: 130px; left: 230px; }
  18%, 22%  { top: 130px; left: 230px; }
  45%       { top: 300px; left: 40px; }
  48%, 52%  { top: 300px; left: 40px; }
  78%       { top: 420px; left: 230px; }
  81%, 85%  { top: 420px; left: 230px; }
  100%      { top: 130px; left: 230px; }
}
@keyframes cursor-click {
  0%, 16%, 26%, 100% { opacity: 0; transform: scale(1); }
  19% { opacity: 1; transform: scale(1.7); }
  24% { opacity: 0; transform: scale(2); }
}

.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px 22px; margin-bottom: 18px;
  transition: transform .15s ease, box-shadow .15s ease;
}

.auth-wrap { max-width: 380px; margin: 90px auto; padding: 0 24px; }
.auth-wrap h1 { font-size: 22px; margin-bottom: 18px; text-align: center; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); }
.field input {
  padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel2); color: var(--fg); font-size: 14px;
}
.field input:focus { outline: none; border-color: var(--accent); }
.error { color: var(--red); font-size: 13px; margin-bottom: 14px; }

.dashboard { max-width: 1000px; margin: 0 auto; padding: 28px 24px 60px; }
.dashboard h1 { font-size: 24px; margin-bottom: 4px; }
.dashboard .sub { color: var(--muted); font-size: 13px; margin-bottom: 24px; }

.filter-bar {
  display: flex; align-items: end; gap: 12px; margin-bottom: 22px; flex-wrap: wrap;
}
.filter-bar .field { margin-bottom: 0; }
.filter-bar input[type="date"] {
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel2); color: var(--fg); font-size: 13px;
}
.quick-ranges { display: flex; gap: 6px; }
.quick-ranges a.btn { padding: 8px 12px; font-size: 13px; }

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px; margin-bottom: 28px;
}
.stat-tile {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.stat-tile:hover { transform: translateY(-3px); box-shadow: 0 14px 28px -14px rgba(0,0,0,.6); }
.stat-tile .value { font-size: 30px; font-weight: 700; color: var(--accent); }
.stat-tile .label { font-size: 12px; color: var(--muted); margin-top: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; padding: 10px 12px; color: var(--muted); font-weight: 600;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
tbody tr:hover { background: var(--panel2); }
.empty { padding: 30px; text-align: center; color: var(--muted); }
