/* ============================================================
   phuong.labs — Dark Terminal Landing Page
   Design: monospace code aesthetic, teal/green accents
   ============================================================ */

/* --- RESET & BASE --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Core palette */
  --bg-deep: #0a0e14;
  --bg-surface: #0d1117;
  --bg-elevated: #161b22;
  --bg-card: #13171e;

  /* Text */
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;

  /* Accents */
  --accent: #00ffc8;
  --accent-dim: #00d4a4;
  --accent-glow: rgba(0, 255, 200, 0.15);
  --accent-glow-strong: rgba(0, 255, 200, 0.3);
  --teal: #2dd4bf;
  --green: #39d353;
  --blue: #58a6ff;
  --yellow: #e3b341;
  --red: #f85149;
  --orange: #f0883e;

  /* Borders */
  --border: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(0, 255, 200, 0.2);

  /* Fonts */
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Sizing */
  --max-width: 1100px;
  --nav-height: 60px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-mono);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* --- CRT & GRID OVERLAYS --- */
.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

.grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(rgba(0, 255, 200, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 200, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* --- NAV --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(10, 14, 20, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.terminal-prompt {
  color: var(--accent);
  font-weight: 800;
  font-size: 18px;
}

.brand-text { color: var(--text-primary); }
.accent { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  transition: color 0.2s;
  position: relative;
}

.nav-link:hover { color: var(--accent); }

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s;
}

.nav-link:hover::after { width: 100%; }

.nav-link--gh {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-link--gh:hover {
  border-color: var(--border-accent);
  background: var(--accent-glow);
  color: var(--accent);
}

.nav-link--gh::after { display: none; }

/* --- HERO --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-height) + 40px) 24px 60px;
  gap: 60px;
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 20%;
  left: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  animation: glow-pulse 4s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
  0% { opacity: 0.4; transform: scale(0.9); }
  100% { opacity: 0.7; transform: scale(1.1); }
}

.hero-terminal {
  flex: 1;
  max-width: 500px;
}

.hero-content {
  flex: 1;
  max-width: 500px;
}

/* --- TERMINAL WINDOW --- */
.terminal-window {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0, 255, 200, 0.05),
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(0, 255, 200, 0.03);
  transition: box-shadow 0.3s, transform 0.3s;
}

.terminal-window:hover {
  box-shadow:
    0 0 0 1px rgba(0, 255, 200, 0.1),
    0 25px 80px rgba(0, 0, 0, 0.6),
    0 0 120px rgba(0, 255, 200, 0.05);
  transform: translateY(-2px);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }

.terminal-title {
  margin-left: 8px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.terminal-body {
  padding: 18px 20px;
  font-size: 13px;
  line-height: 1.8;
}

.terminal-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.prompt {
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.typed-text {
  color: var(--text-primary);
}

.typed-text::after {
  content: '▊';
  color: var(--accent);
  animation: blink-cursor 1s step-end infinite;
  margin-left: 2px;
}

.typed-text.done::after { display: none; }

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Git output */
.terminal-output {
  margin-top: 10px;
}

.git-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  opacity: 0;
  transform: translateY(8px);
  animation: line-appear 0.4s forwards;
  padding: 2px 0;
}

.git-line.delay-1 { animation-delay: 1.5s; }
.git-line.delay-2 { animation-delay: 2.0s; }
.git-line.delay-3 { animation-delay: 2.5s; }
.git-line.delay-4 { animation-delay: 3.0s; }
.git-line.delay-5 { animation-delay: 3.5s; }
.git-line.delay-6 { animation-delay: 4.0s; }

@keyframes line-appear {
  to { opacity: 1; transform: translateY(0); }
}

.git-branch {
  color: var(--accent);
  font-weight: 700;
}

.git-hash {
  color: var(--yellow);
  font-size: 12px;
}

.git-msg {
  color: var(--text-secondary);
  font-size: 12px;
}

.cursor-block {
  color: var(--accent);
  animation: blink-cursor 1s step-end infinite;
}

/* Hero Content */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px 4px 8px;
  border: 1px solid var(--border-accent);
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--accent);
  background: var(--accent-glow);
  margin-bottom: 24px;
  text-transform: uppercase;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: dot-pulse 2s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--accent-glow-strong); }
  50% { opacity: 0.6; box-shadow: 0 0 0 6px transparent; }
}

.hero-title {
  font-family: var(--font-sans);
  font-size: 44px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.hero-title--accent {
  background: linear-gradient(135deg, var(--accent), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cursor-blink {
  -webkit-text-fill-color: var(--accent);
  animation: blink-cursor 1s step-end infinite;
}

.hero-sub {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.mono {
  color: var(--accent);
  font-weight: 500;
}

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

.btn-primary-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--accent);
  color: var(--bg-deep);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  transition: all 0.2s;
  border: 1px solid var(--accent);
}

.btn-primary-hero:hover {
  background: transparent;
  color: var(--accent);
  box-shadow: 0 0 30px var(--accent-glow);
}

.btn-icon {
  font-size: 16px;
  transition: transform 0.2s;
}

.btn-primary-hero:hover .btn-icon {
  transform: translateX(4px);
}

.btn-secondary-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.btn-secondary-hero:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* --- SECTIONS --- */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  padding: 4px 12px;
  margin-bottom: 16px;
  font-family: var(--font-mono);
}

.prompt-mini { font-weight: 700; }

.section-title {
  font-family: var(--font-sans);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.section-sub {
  font-size: 14px;
  color: var(--text-secondary);
}

/* --- TOOLS SECTION --- */
.tools-section {
  padding: 80px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

/* --- TOOL CARD --- */
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--teal), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.tool-card:hover::before { opacity: 1; }

.tool-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 40px var(--accent-glow);
}

.tool-card-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), var(--accent-glow) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.tool-card:hover .tool-card-glow { opacity: 0.5; }

/* Coming soon card */
.tool-card--soon {
  border-style: dashed;
  border-color: var(--text-muted);
}

.tool-card--soon:hover {
  border-color: var(--text-secondary);
  box-shadow: none;
  transform: translateY(-2px);
}

.tool-desc--soon {
  flex: 1;
}

.tool-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tool-icon--screenshot {
  background: linear-gradient(135deg, rgba(0, 255, 200, 0.1), rgba(0, 212, 164, 0.05));
  border: 1px solid rgba(0, 255, 200, 0.15);
  color: var(--accent);
}

.tool-icon--suspender {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.1), rgba(88, 166, 255, 0.05));
  border: 1px solid rgba(88, 166, 255, 0.15);
  color: var(--blue);
}

.tool-icon--soon {
  background: linear-gradient(135deg, rgba(136, 136, 136, 0.1), rgba(136, 136, 136, 0.05));
  border: 1px solid rgba(136, 136, 136, 0.15);
  color: var(--text-muted);
}

.tool-icon--jira {
  background: linear-gradient(135deg, rgba(240, 136, 62, 0.1), rgba(240, 136, 62, 0.05));
  border: 1px solid rgba(240, 136, 62, 0.15);
  color: var(--orange);
}

.tool-icon--devtools {
  background: linear-gradient(135deg, rgba(163, 113, 247, 0.1), rgba(163, 113, 247, 0.05));
  border: 1px solid rgba(163, 113, 247, 0.15);
  color: #a371f7;
}

.tool-meta { flex: 1; }

.tool-name {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.tool-version {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.tool-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}

.tool-status--live {
  color: var(--green);
  background: rgba(57, 211, 83, 0.1);
  border: 1px solid rgba(57, 211, 83, 0.2);
}

.tool-status--wip {
  color: var(--yellow);
  background: rgba(227, 179, 65, 0.1);
  border: 1px solid rgba(227, 179, 65, 0.2);
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: dot-pulse 2s ease-in-out infinite;
}

.tool-desc {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

/* Feature list */
.tool-features {
  margin-bottom: 16px;
}

.feature-terminal {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}

.feature-line {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 3px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.feat-marker {
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

/* Shortcuts */
.tool-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.shortcut-pill {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.shortcut-pill kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--accent);
}

/* Tech tags */
.tool-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.tech-tag {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  letter-spacing: 0.3px;
}

/* Tool footer */
.tool-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.tool-footer--soon {
  border-top: none;
  justify-content: flex-start;
  margin-top: auto;
  padding-top: 0;
}

.tool-pricing {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.price-free {
  color: var(--green);
  font-weight: 500;
}

.price-divider {
  color: var(--text-muted);
}

.price-pro {
  color: var(--text-secondary);
  font-weight: 600;
}

.price-period {
  font-weight: 400;
  color: var(--text-muted);
}

.tool-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--accent);
  color: var(--bg-deep);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  transition: all 0.2s;
}

.tool-cta:hover {
  box-shadow: 0 0 20px var(--accent-glow-strong);
  transform: scale(1.02);
}

.tool-cta--soon {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.tool-cta--soon:hover {
  border-color: var(--border-accent);
  color: var(--accent);
  box-shadow: none;
}

/* --- STACK SECTION --- */
.stack-section {
  padding: 80px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.stack-terminal {
  max-width: 700px;
  margin: 0 auto;
}

.terminal-window--wide {
  width: 100%;
}

.stack-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stack-row {
  display: flex;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  align-items: baseline;
}

.stack-row:last-child { border-bottom: none; }

.stack-label {
  color: var(--accent);
  font-weight: 600;
  min-width: 120px;
  flex-shrink: 0;
}

.stack-value {
  color: var(--text-secondary);
}

/* --- PHILOSOPHY --- */
.philosophy-section {
  padding: 60px 24px 80px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.phil-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.phil-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.3s;
}

.phil-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.phil-icon {
  font-size: 28px;
  margin-bottom: 14px;
  filter: grayscale(30%);
}

.phil-title {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.phil-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* --- FOOTER --- */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  background: var(--bg-surface);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-terminal {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.footer-links a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--accent); }

.footer-sep { color: var(--text-muted); }
.footer-copy { color: var(--text-muted); }

/* --- SCROLL ANIMATIONS --- */
.tool-card,
.phil-card,
.stack-terminal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.tool-card.visible,
.phil-card.visible,
.stack-terminal.visible {
  opacity: 1;
  transform: translateY(0);
}

.tool-card:nth-child(2) { transition-delay: 0.1s; }
.tool-card:nth-child(3) { transition-delay: 0.2s; }
.tool-card:nth-child(4) { transition-delay: 0.3s; }
.tool-card:nth-child(5) { transition-delay: 0.4s; }

.phil-card:nth-child(2) { transition-delay: 0.1s; }
.phil-card:nth-child(3) { transition-delay: 0.2s; }
.phil-card:nth-child(4) { transition-delay: 0.3s; }

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding-top: calc(var(--nav-height) + 60px);
    gap: 40px;
  }

  .hero-terminal { max-width: 100%; }
  .hero-content { max-width: 100%; }

  .hero-title { font-size: 32px; }
  .hero-sub br { display: none; }

  .hero-actions { justify-content: center; }
}

@media (max-width: 640px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }

  .hero-title { font-size: 28px; }

  .nav-links { gap: 12px; }

  .nav-link:not(.nav-link--gh) { display: none; }

  .footer-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .stack-row {
    flex-direction: column;
    gap: 4px;
  }

  .stack-label { min-width: unset; }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
}

/* --- SELECTION --- */
::selection {
  background: var(--accent);
  color: var(--bg-deep);
}

/* --- SCROLLBAR --- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}
