/* ================================================================
   Mainframe Theme — style.css
   Warm parchment + terracotta Unix/terminal aesthetic
   Fixed LEFT SIDEBAR navigation
   ================================================================ */

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

/* ── Design Tokens ── */
:root {
  --bg:          #f0e6d3;
  --fg:          #2c1810;
  --primary:     #c75a3a;
  --accent:      #2e8b6a;
  --accent-nav:  #3ba5a5;
  --card-bg:     #f5edd8;
  --muted:       #6b5744;
  --muted-bg:    #ddd0b8;
  --secondary-bg:#e8dcc6;
  --border:      #2c1810;
  --shadow:      #a0907a;
  --radius:      0px;
  --max-w:       1280px;
  --font-heading:'JetBrains Mono', monospace;
  --font-body:   'Inter', sans-serif;
  --sidebar-w:   20%;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.65;
  min-height: 100vh;
  padding-left: var(--sidebar-w);
}
img {
  max-width: 100%;
  display: block;
  border-radius: 0;
  border: 2px solid var(--border);
  box-shadow: 3px 3px 0 var(--shadow);
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
h1,h2,h3,h4,h5,h6 { font-family: var(--font-heading); line-height: 1.15; font-weight: 700; }

/* ── Utility ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.75rem;
  font-family: var(--font-heading);
}
.section-heading {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}
.section-sub {
  color: var(--muted);
  max-width: 640px;
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 0;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s, background 0.2s;
  box-shadow: 4px 4px 0 var(--shadow);
  font-family: var(--font-heading);
}
.btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--shadow);
}
.btn:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 var(--shadow);
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: #b5502f; }
.btn-outline {
  background: transparent;
  color: var(--fg);
}
.btn-outline:hover { background: var(--muted-bg); }

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg);
  border-right: 3px solid var(--border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar-logo {
  background: var(--primary);
  padding: 1.25rem 1.5rem;
  border-bottom: 3px solid var(--border);
}
.sidebar-logo a {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  color: #fff;
  letter-spacing: 0.05em;
  text-decoration: none;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
  flex: 1;
}
.sidebar-nav a {
  display: block;
  padding: 0.75rem 1.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
  font-family: var(--font-heading);
  transition: background 0.15s, color 0.15s;
  border-left: 4px solid transparent;
}
.sidebar-nav a:hover {
  background: var(--muted-bg);
  border-left-color: var(--primary);
}
.sidebar-nav a.active {
  background: var(--accent-nav);
  color: #fff;
  border: 2px solid var(--border);
  box-shadow: 3px 3px 0 var(--shadow);
  margin: 0.125rem 0.75rem;
  padding: 0.625rem 0.75rem;
  border-left-width: 2px;
}

/* Mobile hamburger bar — hidden on desktop */
.mobile-topbar {
  display: none;
}

/* Hide old navbar — sidebar replaces it */
.navbar { display: none; }

/* ── Footer ── */
.footer {
  border-top: 3px solid var(--border);
  background: var(--card-bg);
  padding: 2.5rem 0;
  margin-top: 5rem;
}
.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.footer-brand {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--primary);
}
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--muted); font-size: 0.85rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--fg); }
.footer-copy { color: var(--muted); font-size: 0.8rem; }

/* ── Theme Switcher ── */
.theme-switcher {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
}
.theme-switcher-btn {
  width: 48px;
  height: 48px;
  border-radius: 0;
  background: var(--card-bg);
  border: 2px solid var(--border);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  box-shadow: 3px 3px 0 var(--shadow);
  transition: transform 0.1s, box-shadow 0.1s;
}
.theme-switcher-btn:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--shadow);
}
.theme-switcher-dropdown {
  display: none;
  position: absolute;
  bottom: 56px;
  right: 0;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 0;
  padding: 0.5rem;
  min-width: 160px;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 4px 4px 0 var(--shadow);
}
.theme-switcher-dropdown.open { display: block; }
.theme-switcher-dropdown a {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 0;
  color: var(--muted);
  font-family: var(--font-heading);
  transition: background 0.15s, color 0.15s;
}
.theme-switcher-dropdown a:hover { background: var(--muted-bg); color: var(--fg); }
.theme-switcher-dropdown a.current { color: var(--primary); font-weight: 600; }

/* ── Cards ── */
.card {
  background: var(--card-bg);
  border: 3px solid var(--border);
  border-radius: 0;
  padding: 2rem;
  box-shadow: 6px 6px 0 var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover {
  transform: translate(2px, 2px);
  box-shadow: 4px 4px 0 var(--shadow);
}

/* ── Hero ── */
.hero {
  position: relative;
  padding: 6rem 0 5rem;
  overflow: hidden;
  text-align: center;
  border-bottom: 3px solid var(--border);
}
.hero-aurora {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
  color: var(--fg);
}
.hero h1 .highlight { color: var(--primary); }
.hero p {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 560px;
  margin: 0 auto 2rem;
}
.hero-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Logo bar ── */
.logo-bar {
  padding: 3rem 0;
  text-align: center;
  border-bottom: 3px solid var(--border);
}
.logo-bar p { color: var(--muted); font-size: 0.85rem; margin-bottom: 1.5rem; text-transform: uppercase; letter-spacing: 0.1em; font-family: var(--font-heading); }
.logo-bar-logos {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
}
.logo-bar-logos span {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--muted);
  opacity: 0.6;
}

/* ── Stats bar ── */
.stats-bar {
  padding: 3rem 0;
  border-bottom: 3px solid var(--border);
}
.stats-bar .container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  text-align: center;
}
.stat {
  padding: 1.5rem;
  border: 2px solid var(--border);
  border-radius: 0;
  box-shadow: 4px 4px 0 var(--shadow);
}
.stat-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}
.stat-label { color: var(--muted); font-size: 0.85rem; margin-top: 0.25rem; font-family: var(--font-heading); }

/* ── Features ── */
.features { padding: 5rem 0; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 0;
  background: var(--muted-bg);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--primary);
}
.feature-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-family: var(--font-heading);
}
.feature-desc { color: var(--muted); font-size: 0.9rem; }

/* ── Code Preview ── */
.code-preview {
  padding: 5rem 0;
  border-top: 3px solid var(--border);
}
.code-preview .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.code-left .checklist { margin-top: 1.5rem; }
.code-left .checklist li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.code-left .checklist li::before {
  content: '\2713';
  color: var(--accent);
  font-weight: 700;
}
.code-block {
  background: var(--card-bg);
  border: 3px solid var(--border);
  border-left: 6px solid var(--primary);
  border-radius: 0;
  padding: 1.75rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.75;
  box-shadow: 6px 6px 0 var(--shadow);
}
.code-block .kw { color: var(--muted); }
.code-block .str { color: var(--primary); }
.code-block .val { color: var(--accent); }
.code-block .cm { color: #8a7a64; }

/* ── Showcase ── */
.showcase {
  padding: 5rem 0;
  background: var(--secondary-bg);
  border-top: 3px solid var(--border);
  border-bottom: 3px solid var(--border);
}
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.showcase-card {
  background: var(--card-bg);
  border: 3px solid var(--border);
  border-radius: 0;
  padding: 2rem;
  box-shadow: 6px 6px 0 var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.showcase-card:hover {
  transform: translate(2px, 2px);
  box-shadow: 4px 4px 0 var(--shadow);
}
.showcase-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}
.showcase-card p { color: var(--muted); font-size: 0.9rem; }

/* ── Testimonials ── */
.testimonials { padding: 5rem 0; }
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.testimonial-card { text-align: center; }
.testimonial-avatar {
  width: 64px;
  height: 64px;
  border-radius: 0 !important;
  border: 3px solid var(--border) !important;
  box-shadow: 3px 3px 0 var(--shadow) !important;
  background: var(--muted-bg);
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}
.testimonial-quote {
  color: var(--muted);
  font-style: italic;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}
.testimonial-name { font-weight: 700; font-size: 0.9rem; }
.testimonial-role { color: var(--muted); font-size: 0.8rem; }

/* ── Pricing ── */
.pricing {
  padding: 5rem 0;
  background: var(--secondary-bg);
  border-top: 3px solid var(--border);
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
}
.pricing-card { text-align: center; }
.pricing-card.featured {
  border-color: var(--primary);
  box-shadow: 8px 8px 0 var(--shadow);
  position: relative;
}
.pricing-badge {
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 1rem;
  border-radius: 0;
  border: 2px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--font-heading);
}
.pricing-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.pricing-price {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.25rem;
  font-family: var(--font-heading);
}
.pricing-price span { font-size: 1rem; font-weight: 400; color: var(--muted); }
.pricing-features {
  margin: 1.5rem 0;
  text-align: left;
}
.pricing-features li {
  padding: 0.4rem 0;
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pricing-features li::before {
  content: '\2713';
  color: var(--accent);
  font-weight: 700;
}
.pricing-card .btn { width: 100%; justify-content: center; }

/* ── Blog cards ── */
.blog-preview { padding: 5rem 0; }
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.blog-card .card { display: flex; flex-direction: column; gap: 0.75rem; }
.blog-tag {
  display: inline-block;
  background: var(--muted-bg);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 0;
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-heading);
}
.blog-card h3 { font-size: 1.1rem; }
.blog-card p { color: var(--muted); font-size: 0.9rem; }
.blog-card .meta { color: var(--muted); font-size: 0.8rem; font-family: var(--font-heading); }

/* ── FAQ ── */
.faq-section { padding: 5rem 0; }
.faq-item {
  border: 2px solid var(--border);
  border-radius: 0;
  margin-bottom: 0.75rem;
  overflow: hidden;
  box-shadow: 3px 3px 0 var(--shadow);
}
.faq-question {
  width: 100%;
  padding: 1.25rem 1.5rem;
  background: var(--card-bg);
  border: none;
  color: var(--fg);
  font-weight: 600;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
  font-family: var(--font-heading);
}
.faq-question:hover { background: var(--muted-bg); }
.faq-question .icon {
  font-size: 1.25rem;
  transition: transform 0.3s;
  color: var(--primary);
  font-family: var(--font-heading);
}
.faq-item.open .faq-question .icon { transform: rotate(45deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  background: var(--card-bg);
}
.faq-item.open .faq-answer {
  max-height: 300px;
}
.faq-answer-inner {
  padding: 0 1.5rem 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ── CTA ── */
.cta {
  padding: 5rem 0;
  background: var(--primary);
  text-align: center;
  border-top: 3px solid var(--border);
}
.cta h2 { font-size: clamp(2rem, 4vw, 2.75rem); margin-bottom: 1rem; color: #fff; }
.cta p { color: rgba(255,255,255,0.85); margin-bottom: 2rem; max-width: 560px; margin-left: auto; margin-right: auto; }
.cta .btn-primary { background: #fff; color: var(--primary); border-color: var(--border); }
.cta .btn-primary:hover { background: var(--bg); }
.cta .btn-outline { border-color: rgba(255,255,255,0.5); color: #fff; }
.cta .btn-outline:hover { border-color: #fff; background: rgba(255,255,255,0.1); }

/* ── Page sections ── */
.page-header {
  padding: 4rem 0 2.5rem;
  text-align: center;
  border-bottom: 3px solid var(--border);
}
.page-header h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 0.75rem; }
.page-header p { color: var(--muted); max-width: 560px; margin: 0 auto; }
.page-body { padding: 4rem 0; }

/* ── Blog page ── */
.blog-grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* ── About ── */
.about-story { max-width: 700px; margin: 0 auto 3rem; color: var(--muted); text-align: center; line-height: 1.75; }
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 4rem;
}
.team-card { text-align: center; }
.team-avatar {
  width: 80px;
  height: 80px;
  border-radius: 0 !important;
  border: 3px solid var(--border) !important;
  box-shadow: 3px 3px 0 var(--shadow) !important;
  background: var(--muted-bg);
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}
.team-card h3 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.team-card p { color: var(--muted); font-size: 0.85rem; }
.mission {
  text-align: center;
  padding: 3rem 0;
  border-top: 3px solid var(--border);
}
.mission h2 { margin-bottom: 1rem; }
.mission p { color: var(--muted); max-width: 600px; margin: 0 auto; }

/* ── Contact ── */
.contact-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2.5rem;
}
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--fg);
  font-family: var(--font-heading);
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 0;
  color: var(--fg);
  font-size: 0.95rem;
  transition: border-color 0.2s;
  box-shadow: 3px 3px 0 var(--shadow);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.office-sidebar .card { margin-bottom: 1rem; }
.office-sidebar h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.office-sidebar p { color: var(--muted); font-size: 0.9rem; }

/* ── KB ── */
.kb-search {
  max-width: 500px;
  margin: 0 auto 2.5rem;
  position: relative;
}
.kb-search input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 0;
  color: var(--fg);
  font-size: 0.95rem;
  box-shadow: 3px 3px 0 var(--shadow);
}
.kb-search input:focus { outline: none; border-color: var(--primary); }
.kb-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.kb-category h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--border);
}
.kb-category + .kb-category { margin-top: 2.5rem; }
.kb-articles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.kb-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.kb-card p { color: var(--muted); font-size: 0.85rem; }

/* ── Announcement Banner ── */
.announcement-banner {
  border-bottom: 2px solid var(--border) !important;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  body {
    padding-left: 0;
    padding-top: 3.5rem;
  }

  .sidebar {
    display: none;
  }
  .sidebar.open {
    display: flex;
    width: 260px;
    top: 3.5rem;
    height: calc(100vh - 3.5rem);
    box-shadow: 6px 0 0 var(--shadow);
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3.5rem;
    background: var(--primary);
    border-bottom: 3px solid var(--border);
    padding: 0 1rem;
    z-index: 101;
  }
  .mobile-topbar .mobile-brand {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.1rem;
    color: #fff;
    letter-spacing: 0.05em;
  }
  .mobile-topbar .mobile-toggle {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
  }

  .stats-bar .container { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: 1fr; }
  .code-preview .container { grid-template-columns: 1fr; }
  .showcase-grid { grid-template-columns: 1fr; }
  .testimonials-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .blog-grid-4 { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .kb-articles { grid-template-columns: 1fr; }
  .footer .container { flex-direction: column; text-align: center; }
}
