/* ============================================================
   SULLA DESKTOP — Brand CSS
   Single source of truth for the Sulla brand visual system.
   Based on the Merchant Protocol "Noir Terminal Editorial" design guide.
   ============================================================ */

/* ============================================================
   1. CSS CUSTOM PROPERTIES
   ============================================================ */

:root {
  /* Backgrounds — darkest to lightest */
  --bg: #0d1117;
  --surface-1: #161b22;
  --surface-2: #1c2128;
  --surface-3: #21262d;

  /* Borders */
  --border: #30363d;
  --border-muted: #21262d;

  /* Text */
  --text: #e6edf3;
  --text-muted: #8b949e;
  --text-dim: #6e7681;

  /* Blue accent system */
  --green: #5096b3;
  --green-bright: #6ab0cc;
  --green-glow: rgba(80, 150, 179, 0.4);
  --green-glow-soft: rgba(106, 176, 204, 0.15);
  --green-glow-strong: rgba(106, 176, 204, 0.6);

  /* Terminal traffic light dots */
  --red-dot: #ff5f57;
  --yellow-dot: #febc2e;
  --green-dot: #28c840;

  /* Font families */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ============================================================
   2. BASE STYLES
   ============================================================ */

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

body {
  font-family: var(--font-mono);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.7;
}

::selection {
  background: var(--green);
  color: #fff;
}

::-webkit-scrollbar {
  width: 6px;
}

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

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

a {
  color: var(--green-bright);
  text-decoration: none;
  transition: color 0.3s, text-shadow 0.3s;
}

a:hover {
  color: #fff;
  text-shadow: 0 0 10px var(--green-glow);
}

img {
  max-width: 100%;
  height: auto;
}

/* ============================================================
   3. NAVIGATION
   ============================================================ */

#main-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9000;
  height: 64px;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(48, 54, 61, 0.5);
  transition: background 0.3s, box-shadow 0.3s;
}

#main-nav.scrolled {
  background: rgba(13, 17, 23, 0.95);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  padding: 0 2rem;
}

.nav-logo-text {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text);
}

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

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s;
}

.nav-link:hover {
  color: var(--green-bright);
  text-shadow: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

/* ============================================================
   4. MOBILE MENU
   ============================================================ */

.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9500;
  background: var(--bg);
  opacity: 0.98;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.mobile-menu.active {
  display: flex;
}

.mobile-menu-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.mobile-menu-link {
  font-family: var(--font-mono);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
  text-decoration: none;
  transition: color 0.3s;
}

.mobile-menu-link:hover {
  color: var(--green-bright);
  text-shadow: none;
}

/* ============================================================
   5. BUTTONS
   ============================================================ */

.btn-primary {
  display: inline-block;
  padding: 14px 32px;
  background: var(--green);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 8px;
  letter-spacing: 0.05em;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
}

.btn-primary:hover {
  background: var(--green-bright);
  color: #fff;
  box-shadow: 0 0 30px var(--green-glow-strong);
  transform: translateY(-2px);
  text-shadow: none;
}

.btn-outline {
  display: inline-block;
  padding: 14px 32px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 8px;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
}

.btn-outline:hover {
  border-color: var(--green);
  color: var(--green-bright);
  box-shadow: 0 0 20px var(--green-glow-soft);
  transform: translateY(-2px);
  text-shadow: none;
}

/* ============================================================
   6. SECTION LABELS
   ============================================================ */

.section-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--green-bright);
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-label::before {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--green-bright);
}

/* ============================================================
   7. TYPOGRAPHY
   ============================================================ */

h1 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.05;
  color: var(--text);
}

h2 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.1;
  color: var(--text);
}

h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

h1 em,
h2 em {
  color: var(--green-bright);
  font-style: italic;
  text-shadow: 0 0 40px var(--green-glow);
}

.hero-headline {
  font-size: clamp(3rem, 8vw, 6.5rem);
}

.section-headline {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.stat-number {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 3rem;
  line-height: 1;
  color: var(--green-bright);
  text-shadow: 0 0 20px var(--green-glow), 0 0 40px var(--green-glow-soft);
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

.body-text {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 2;
  color: var(--text-muted);
}

.drop-cap::first-letter {
  font-size: 4.5rem;
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--green-bright);
  float: left;
  line-height: 0.75;
  margin-right: 0.5rem;
}

/* ============================================================
   8. CARDS
   ============================================================ */

.brand-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.4s;
}

.brand-card:hover {
  border-color: var(--green);
  box-shadow: 0 0 20px rgba(80, 150, 179, 0.1);
}

/* ============================================================
   9. TERMINAL WINDOW CHROME
   ============================================================ */

.terminal-window {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

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

.terminal-dot.red {
  background: #ff5f57;
}

.terminal-dot.yellow {
  background: #febc2e;
}

.terminal-dot.green {
  background: #28c840;
}

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: auto;
  margin-right: auto;
}

.terminal-body {
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--text-muted);
  max-height: 500px;
  overflow-y: auto;
}

.terminal-body .prompt {
  color: var(--green-bright);
}

.terminal-body .cmd {
  color: var(--text);
}

/* ============================================================
   10. FOOTER
   ============================================================ */

.site-footer {
  background: var(--bg);
  border-top: 3px solid var(--green-bright);
  box-shadow: 0 -4px 20px var(--green-glow-soft);
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 4rem 2rem 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: 2.5rem;
}

.footer-heading {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green-bright);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--green-bright);
  text-shadow: none;
}

.footer-tagline {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-social {
  display: flex;
  gap: 1rem;
}

.social-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.3s;
}

.social-icon:hover {
  border-color: var(--green-bright);
  color: var(--green-bright);
  background: rgba(106, 176, 204, 0.08);
  text-shadow: none;
}

.footer-bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* ============================================================
   11. CRT OVERLAY (ATMOSPHERIC EFFECTS)
   ============================================================ */

.crt-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
}

.crt-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
}

.crt-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 50%,
    rgba(0, 0, 0, 0.4) 100%
  );
}

.film-grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
  animation: grain 0.5s steps(4) infinite;
}

@keyframes grain {
  0%,
  100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-5px, 5px);
  }
  50% {
    transform: translate(5px, -5px);
  }
  75% {
    transform: translate(-5px, -5px);
  }
}

.cursor-glow {
  width: 400px;
  height: 400px;
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  border-radius: 50%;
  background: radial-gradient(
    ellipse,
    rgba(80, 150, 179, 0.12) 0%,
    rgba(80, 150, 179, 0.04) 40%,
    transparent 70%
  );
  transition: opacity 0.3s;
  opacity: 0;
}

/* ============================================================
   12. NOIR SECTION GLOW
   ============================================================ */

section {
  position: relative;
}

section::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  height: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(80, 150, 179, 0.08) 0%,
    rgba(80, 150, 179, 0.03) 40%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   13. SCROLL REVEAL
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.from-left {
  transform: translateX(-60px);
}

.reveal.from-right {
  transform: translateX(60px);
}

.reveal.scale-up {
  transform: scale(0.9);
}

.reveal.revealed {
  opacity: 1;
  transform: none;
}

/* ============================================================
   13. DIVIDERS
   ============================================================ */

.green-rule {
  height: 3px;
  background: var(--green-bright);
  box-shadow: 0 0 12px var(--green-glow), 0 0 4px var(--green-glow);
  border: none;
}

.cinematic-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--green) 35%,
    var(--green-bright) 50%,
    var(--green) 65%,
    transparent 100%
  );
  box-shadow: 0 0 15px var(--green-glow), 0 0 30px var(--green-glow-soft);
}

/* ============================================================
   14. CODE BLOCKS
   ============================================================ */

pre {
  background: #1a1e24;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--text-muted);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  overflow-x: auto;
}

code {
  background: var(--surface-2);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--green-bright);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  border: none;
  font-size: inherit;
  color: inherit;
}

/* ============================================================
   15. BLOCKQUOTES
   ============================================================ */

blockquote {
  border-left: 3px solid var(--green);
  padding: 1.5rem 0 1.5rem 1.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-style: italic;
  font-size: 1.6rem;
  line-height: 1.5;
  color: var(--text);
  box-shadow: 0 0 12px var(--green-glow), -4px 0 20px var(--green-glow);
}

/* ============================================================
   16. TABLES
   ============================================================ */

table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 8px;
}

th {
  background: var(--surface-2);
  color: var(--green-bright);
  text-transform: uppercase;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  border-bottom: 2px solid var(--green);
  padding: 0.65rem 1rem;
  text-align: left;
}

td {
  padding: 0.65rem 1rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

tr:hover {
  background: var(--surface-1);
}

/* ============================================================
   17. RESPONSIVE BREAKPOINTS
   ============================================================ */

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  .nav-container {
    padding: 0 1.5rem;
  }

  .footer-container {
    padding: 3rem 1.5rem 1.5rem;
  }

  .hero-headline {
    font-size: clamp(2.2rem, 7vw, 4rem);
  }

  .section-headline {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
  }

  .brand-card {
    padding: 1.5rem;
  }

  .terminal-body {
    padding: 16px 18px;
    font-size: 0.8rem;
  }

  blockquote {
    font-size: 1.3rem;
    padding: 1rem 0 1rem 1rem;
  }

  .btn-primary,
  .btn-outline {
    padding: 12px 24px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .nav-container {
    padding: 0 1rem;
  }

  .footer-container {
    padding: 2.5rem 1rem 1rem;
  }

  .hero-headline {
    font-size: clamp(2rem, 7vw, 3rem);
  }

  .section-headline {
    font-size: clamp(1.5rem, 4vw, 2rem);
  }

  .stat-number {
    font-size: 2.2rem;
  }

  .brand-card {
    padding: 1.25rem;
    border-radius: 8px;
  }

  .section-label {
    font-size: 0.6rem;
    letter-spacing: 0.2em;
  }

  .terminal-body {
    padding: 12px 14px;
    font-size: 0.75rem;
  }

  pre {
    padding: 1rem 1.25rem;
    font-size: 0.75rem;
  }

  blockquote {
    font-size: 1.1rem;
  }

  .btn-primary,
  .btn-outline {
    padding: 10px 20px;
    font-size: 0.75rem;
    width: 100%;
    text-align: center;
  }

  th,
  td {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }
}
