/* ============================================
   PHOPY - Website Styles
   Dark terminal-inspired theme
   ============================================ */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Outfit:wght@300;400;500;600;700&display=swap');

/* CSS Variables */
:root {
  /* Colors */
  --bg-primary: #0a0e14;
  --bg-secondary: #0f1419;
  --bg-tertiary: #151b23;
  --bg-card: rgba(21, 27, 35, 0.7);
  --bg-card-hover: rgba(31, 41, 55, 0.8);
  
  --text-primary: #e6e6e6;
  --text-secondary: #8a919a;
  --text-muted: #5c6370;
  
  --accent-primary: #39c5bb;
  --accent-secondary: #59d4cb;
  --accent-glow: rgba(57, 197, 187, 0.3);
  
  --success: #98c379;
  --warning: #e5c07b;
  --error: #e06c75;
  --info: #61afef;
  
  --border-color: rgba(57, 197, 187, 0.2);
  --border-subtle: rgba(255, 255, 255, 0.05);
  
  /* Typography */
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-sans: 'Outfit', system-ui, -apple-system, sans-serif;
  
  /* Spacing */
  --section-padding: 6rem 2rem;
  --container-max: 1200px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background Pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--accent-glow), transparent),
    radial-gradient(circle at 20% 80%, rgba(97, 175, 239, 0.08), transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(152, 195, 121, 0.08), transparent 40%);
  pointer-events: none;
  z-index: -1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-mono);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

p {
  color: var(--text-secondary);
  max-width: 65ch;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-secondary);
}

code, pre {
  font-family: var(--font-mono);
}

/* Container */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ============================================
   NAVIGATION
   ============================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 2rem;
  background: rgba(10, 14, 20, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

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

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.nav-logo-icon {
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  transition: color var(--transition-fast);
}

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

.nav-links a.active {
  color: var(--accent-primary);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 8rem 2rem 4rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent-primary);
  margin-bottom: 2rem;
  animation: fadeInDown 0.6s ease;
}

.hero-title {
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s ease 0.1s both;
}

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

.hero-description {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 4rem;
  animation: fadeInUp 0.6s ease 0.3s both;
}

.hero-video {
  width: 100%;
  max-width: 900px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 
    0 0 0 1px var(--border-color),
    0 20px 50px -20px rgba(0, 0, 0, 0.5),
    0 0 100px -50px var(--accent-glow);
  animation: fadeInUp 0.8s ease 0.4s both;
}

.hero-video video {
  width: 100%;
  display: block;
  border-radius: var(--radius-lg);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--bg-primary);
  box-shadow: 0 4px 20px -5px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px -5px var(--accent-glow);
  color: var(--bg-primary);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.btn-icon {
  font-size: 1.1em;
}

/* ============================================
   FEATURES SECTION
   ============================================ */

.features {
  padding: var(--section-padding);
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header p {
  margin: 0 auto;
  font-size: 1.125rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: var(--container-max);
  margin: 0 auto;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--transition-normal);
  backdrop-filter: blur(10px);
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color);
  transform: translateY(-4px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-glow), transparent);
  border-radius: var(--radius-md);
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.feature-card h3 {
  color: var(--text-primary);
  font-size: 1.125rem;
}

.feature-card p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

/* ============================================
   INSTALLATION SECTION
   ============================================ */

.installation {
  padding: var(--section-padding);
  background: var(--bg-secondary);
}

.install-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.install-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.install-card h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.install-card h3 span {
  font-size: 1.25rem;
}

.code-block {
  position: relative;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.code-block pre {
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.875rem;
  color: var(--accent-primary);
}

.code-block code {
  white-space: pre;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.copy-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.copy-btn.copied {
  color: var(--success);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  padding: 3rem 2rem;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer-content {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.footer-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.footer-copy {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ============================================
   DOCUMENTATION STYLES
   ============================================ */

.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  padding-top: 4rem;
}

.docs-sidebar {
  position: sticky;
  top: 4rem;
  height: calc(100vh - 4rem);
  overflow-y: auto;
  padding: 2rem;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
}

.docs-sidebar h4 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}

.docs-sidebar h4:first-child {
  margin-top: 0;
}

.docs-sidebar ul {
  list-style: none;
}

.docs-sidebar li {
  margin-bottom: 0.25rem;
}

.docs-sidebar a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  transition: all var(--transition-fast);
}

.docs-sidebar a:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.docs-sidebar a.active {
  color: var(--accent-primary);
  background: var(--accent-glow);
}

.docs-content {
  padding: 3rem 4rem;
  max-width: 900px;
}

.docs-content h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.docs-content > p:first-of-type {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
}

.docs-content h2 {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

.docs-content h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.docs-content h3 {
  margin-top: 2rem;
  color: var(--text-primary);
}

.docs-content p {
  margin-bottom: 1rem;
}

.docs-content ul, .docs-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.docs-content li {
  margin-bottom: 0.5rem;
}

.docs-content code {
  background: var(--bg-tertiary);
  padding: 0.2em 0.4em;
  border-radius: var(--radius-sm);
  font-size: 0.875em;
  color: var(--accent-primary);
}

.docs-content pre {
  margin: 1.5rem 0;
}

.docs-content pre code {
  background: transparent;
  padding: 0;
}

/* Reference Tables */
.reference-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}

.reference-table th,
.reference-table td {
  text-align: left;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.reference-table th {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-secondary);
}

.reference-table td {
  color: var(--text-secondary);
}

.reference-table td:first-child {
  font-family: var(--font-mono);
  color: var(--accent-primary);
  white-space: nowrap;
}

.reference-table tr:hover td {
  background: var(--bg-card);
}

/* Format Tags */
.format-tag {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent-primary);
  margin: 0.125rem;
}

.format-tag.raw {
  background: rgba(225, 108, 117, 0.15);
  color: var(--error);
}

.format-tag.jpeg {
  background: rgba(97, 175, 239, 0.15);
  color: var(--info);
}

/* Callout Boxes */
.callout {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  border-left: 4px solid;
}

.callout-info {
  background: rgba(97, 175, 239, 0.1);
  border-color: var(--info);
}

.callout-warning {
  background: rgba(229, 192, 123, 0.1);
  border-color: var(--warning);
}

.callout-tip {
  background: rgba(152, 195, 121, 0.1);
  border-color: var(--success);
}

.callout-title {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.callout-info .callout-title {
  color: var(--info);
}

.callout-warning .callout-title {
  color: var(--warning);
}

.callout-tip .callout-title {
  color: var(--success);
}

.callout p {
  margin: 0;
  font-size: 0.9375rem;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 968px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }
  
  .docs-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  
  .docs-content {
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 4rem 1.5rem;
  }
  
  .nav {
    padding: 0.875rem 1rem;
  }
  
  .nav-links {
    gap: 1rem;
  }
  
  .hero {
    padding: 7rem 1.5rem 3rem;
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
  
  .install-methods {
    grid-template-columns: 1fr;
  }
  
  .reference-table {
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 480px) {
  .nav-links {
    display: none;
  }
  
  .hero-video {
    border-radius: var(--radius-md);
  }
  
  .feature-card {
    padding: 1.5rem;
  }
}
