/* ============================================
   AlphaSystemsLab.com — Main Stylesheet
   ============================================ */

:root {
  --color-bg: #000000;
  --color-bg-alt: #0c0c0c;
  --color-surface: #151515;
  --color-border: #303030;
  --color-text: #f5f5f5;
  --color-text-muted: #b0b0b0;
  --color-accent: #22c55e;
  --color-accent-hover: #4ade80;
  --color-accent-dim: rgba(34, 197, 94, 0.1);
  --color-green: #22c55e;
  color-scheme: dark;
  --color-red: #ff4545;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-width: 1100px;
  --header-height: 72px;
}

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

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

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

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s;
}

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

img {
  max-width: 100%;
  display: block;
}

/* ---- Header / Navigation ---- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: #000000;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: block;
  flex: 0 1 300px;
  min-width: 0;
  margin-right: 1.5rem;
}

.logo img {
  width: 300px;
  height: 64px;
  object-fit: cover;
  object-position: center;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 5px;
}

section[id] {
  scroll-margin-top: calc(var(--header-height) + 1rem);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

nav a {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

nav a:hover,
nav a.active {
  color: var(--color-accent);
}

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

/* ---- Hero ---- */

.hero {
  padding: calc(var(--header-height) + 5rem) 2rem 5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-accent);
  background: var(--color-accent-dim);
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.hero h1 .highlight {
  color: var(--color-accent);
}

.hero p {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  max-width: 640px;
  margin-bottom: 2rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-bg);
}

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

.btn-secondary {
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-accent);
}

/* ---- Sections ---- */

.section {
  padding: 5rem 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-alt .section {
  padding: 5rem 2rem;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.section h2 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.section > p {
  color: var(--color-text-muted);
  max-width: 640px;
  margin-bottom: 3rem;
}

/* ---- Philosophy Grid ---- */

.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
}

.philosophy-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 2rem;
  transition: border-color 0.2s;
}

.philosophy-card:hover {
  border-color: var(--color-accent);
}

.philosophy-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.philosophy-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* ---- Lab Notes (Blog) Grid ---- */

.lab-notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1.5rem;
}

.lab-note-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 2rem;
  transition: border-color 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

.lab-note-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.lab-note-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.lab-note-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.lab-note-card p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  flex: 1;
}

.lab-note-card .read-more {
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---- Services ---- */

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
}

.service-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 2rem;
}

.service-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.service-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.service-card ul {
  list-style: none;
  padding: 0;
}

.service-card ul li {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  padding: 0.25rem 0;
  padding-left: 1.25rem;
  position: relative;
}

.service-card ul li::before {
  content: '>';
  font-family: var(--font-mono);
  color: var(--color-accent);
  position: absolute;
  left: 0;
}

/* ---- About ---- */

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-text p {
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.credentials {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 2rem;
}

.credentials h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--color-accent);
}

.credentials ul {
  list-style: none;
}

.credentials ul li {
  padding: 0.4rem 0;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}

.credentials ul li:last-child {
  border-bottom: none;
}

.client-logos {
  margin-top: 2rem;
}

.client-logos p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* ---- Contact ---- */

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.contact-info p {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.contact-detail {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form input,
.contact-form textarea,
.contact-form select {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  outline: none;
  border-color: var(--color-accent);
}

.contact-form textarea {
  min-height: 120px;
  resize: vertical;
}

.contact-form select option {
  background: var(--color-surface);
}

/* ---- Footer ---- */

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--color-text-muted);
}

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

/* ---- Code Blocks (for lab notes) ---- */

pre {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1.5rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 1.5rem 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--color-accent);
}

/* ---- Responsive ---- */

@media (max-width: 900px) {
  .mobile-menu-btn {
    display: block;
  }

  nav ul {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    padding: 1rem 2rem;
    gap: 1rem;
  }

  nav ul.open {
    display: flex;
  }

  .about-content,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 2rem;
  }
}

/* Red echoes Alpha and the bearish candles; green identifies actions. */
.section-label,
.lab-note-number {
  color: var(--color-red);
}

.philosophy-card,
.service-card {
  border-top: 2px solid var(--color-red);
}

.lab-note-card h3 {
  color: var(--color-text);
}

nav a.btn-primary.active {
  color: var(--color-bg);
}

@media (max-width: 1024px) and (min-width: 901px) {
  .header-inner { padding: 0 1rem; }
  .logo { flex-basis: 240px; margin-right: 1rem; }
  .logo img { width: 240px; height: 52px; }
  nav ul { gap: 1rem; align-items: center; }
}

@media (max-width: 900px) {
  .header-inner { padding: 0 1rem; }
  .logo { flex-basis: 260px; }
  .logo img { width: 260px; height: 56px; }
  .mobile-menu-btn { flex-shrink: 0; padding: 0.25rem; }
}

@media (max-width: 380px) {
  .logo { flex-basis: 220px; margin-right: 0.5rem; }
  .logo img { width: 220px; height: 48px; }
  .hero-label { font-size: 0.65rem; }
}
