/* ============================================
   CONTAINER & BASE LAYOUT
   ============================================ */

body {
  overflow-x: hidden;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
  box-sizing: border-box;
}

* {
  box-sizing: border-box;
}

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

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

.hero-section {
  position: relative;
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 0 2rem;
  overflow: hidden;
  width: 100%;
  justify-content: center;
}

.hero-main-branding {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
      to right,
      rgba(0, 188, 212, 0.03) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, rgba(0, 188, 212, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.5;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  width: 100%;
}

.hero-text {
  display: flex;
  flex-direction: column;
}

.hero-status {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.hero-title {
  font-size: 4rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  background: linear-gradient(
    135deg,
    var(--accent-main) 0%,
    var(--text-primary) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Glitch Effect */
.glitch {
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--accent-main) 0%,
    var(--text-primary) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glitch::before {
  left: 2px;
  text-shadow: -2px 0 var(--accent-main);
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
  left: -2px;
  text-shadow: -2px 0 var(--accent-complementary);
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
  0% {
    clip: rect(10px, 9999px, 98px, 0);
  }
  20% {
    clip: rect(85px, 9999px, 40px, 0);
  }
  40% {
    clip: rect(20px, 9999px, 15px, 0);
  }
  60% {
    clip: rect(95px, 9999px, 60px, 0);
  }
  80% {
    clip: rect(30px, 9999px, 75px, 0);
  }
  100% {
    clip: rect(65px, 9999px, 25px, 0);
  }
}

@keyframes glitch-anim2 {
  0% {
    clip: rect(65px, 9999px, 100px, 0);
  }
  20% {
    clip: rect(25px, 9999px, 35px, 0);
  }
  40% {
    clip: rect(90px, 9999px, 50px, 0);
  }
  60% {
    clip: rect(15px, 9999px, 80px, 0);
  }
  80% {
    clip: rect(70px, 9999px, 20px, 0);
  }
  100% {
    clip: rect(40px, 9999px, 95px, 0);
  }
}

.hero-description {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 540px;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 0.375rem;
  transition: all 0.3s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-main);
  color: var(--bg-primary);
  border: 2px solid var(--accent-main);
}

.btn-primary:hover {
  background: transparent;
  color: var(--accent-main);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 188, 212, 0.2);
}

.btn-primary .btn-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  display: block;
}

.btn-primary svg {
  width: 20px;
  height: 20px;
  display: block;
}

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

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border-subtle);
}

.btn-secondary:hover {
  border-color: var(--accent-main);
  color: var(--accent-main);
  transform: translateY(-2px);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  justify-content: space-between;
  margin-top: 2rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
  min-width: 100px;
  flex: 0 0 auto;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-main);
  font-family: "JetBrains Mono", monospace;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Terminal Visual */
.hero-visual {
  position: relative;
  max-width: 100%;
}

.terminal-window {
  background: var(--bg-secondary);
  border: 2px solid var(--border-subtle);
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
}

.terminal-header {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
}

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

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

.terminal-body {
  padding: 1.5rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
  line-height: 1.6;
}

.terminal-line {
  margin-bottom: 0.5rem;
}

.prompt {
  color: var(--accent-main);
  margin-right: 0.5rem;
}

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

.output {
  color: var(--text-secondary);
  margin-left: 1.5rem;
  margin-top: 0.5rem;
}

.output .accent {
  color: var(--accent-main);
}

.cursor-blink {
  animation: blink 1s infinite;
}

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

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  z-index: 10;
}

.mouse {
  width: 24px;
  height: 40px;
  border: 2px solid var(--border-subtle);
  border-radius: 12px;
  position: relative;
}

.mouse::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: var(--accent-main);
  border-radius: 2px;
  animation: scroll 2s infinite;
}

@keyframes scroll {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(16px);
  }
}

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

.features-section {
  padding: 6rem 0;
  background: var(--bg-primary);
}

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

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

.section-tag {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
  color: var(--accent-main);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.section-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

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

.feature-card {
  position: relative;
  background: var(--bg-secondary);
  border: 2px solid var(--border-subtle);
  border-radius: 0.75rem;
  padding: 2rem;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.feature-card:hover {
  border-color: var(--accent-main);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 188, 212, 0.15);
}

.feature-card.featured {
  grid-column: span 2;
  background: linear-gradient(
    135deg,
    var(--bg-secondary) 0%,
    var(--bg-tertiary) 100%
  );
}

.feature-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  color: var(--accent-main);
  margin-bottom: 1.5rem;
}

.feature-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.feature-description {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.feature-stats {
  display: flex;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-family: "JetBrains Mono", monospace;
}

.feature-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-main);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: all 0.3s ease;
}

.feature-link:hover {
  gap: 1rem;
}

.feature-link.disabled {
  color: var(--text-secondary);
  cursor: not-allowed;
  opacity: 0.5;
}

/* ============================================
   LATEST SECTION
   ============================================ */

.latest-section {
  padding: 6rem 0;
  background: var(--bg-secondary);
}

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

.section-header .view-all-link {
  color: var(--accent-main);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
}

.section-header .view-all-link:hover {
  color: var(--accent-main);
  text-shadow: 0 0 10px rgba(0, 188, 212, 0.5);
}

.latest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}

.latest-card {
  position: relative;
  background: var(--bg-primary);
  border: 2px solid var(--border-subtle);
  border-radius: 0.75rem;
  padding: 2rem;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.latest-card:hover {
  border-color: var(--accent-main);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 188, 212, 0.1);
}

.latest-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 0.25rem;
}

.latest-badge.new {
  background: var(--accent-main);
  color: var(--bg-primary);
}

.latest-badge.recent {
  background: var(--accent-complementary);
  color: var(--text-primary);
}

.latest-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-family: "JetBrains Mono", monospace;
}

.latest-type {
  color: var(--accent-main);
}

.latest-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.latest-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.latest-title a:hover {
  color: var(--accent-main);
}

.latest-excerpt {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.latest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag-pill {
  padding: 0.25rem 0.75rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: 0.25rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.latest-link {
  color: var(--accent-main);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: all 0.3s ease;
}

.latest-link:hover {
  text-shadow: 0 0 10px rgba(0, 188, 212, 0.5);
}

/* ============================================
   CTA SECTION
   ============================================ */

.cta-section {
  padding: 6rem 0;
  background: linear-gradient(
    135deg,
    var(--bg-primary) 0%,
    var(--bg-secondary) 100%
  );
  border-top: 1px solid var(--border-subtle);
}

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

.cta-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.cta-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.cta-description {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.newsletter-form {
  display: flex;
  gap: 1rem;
}

.newsletter-input {
  flex: 1;
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border-subtle);
  border-radius: 0.5rem;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: "JetBrains Mono", monospace;
  transition: all 0.3s ease;
}

.newsletter-input:focus {
  outline: none;
  border-color: var(--accent-main);
  box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.1);
}

.newsletter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: var(--accent-main);
  color: var(--bg-primary);
  border: 2px solid var(--accent-main);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.newsletter-btn:hover {
  background: transparent;
  color: var(--accent-main);
  transform: translateY(-2px);
}

.newsletter-btn svg {
  width: 20px;
  height: 20px;
}

.newsletter-note {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-family: "JetBrains Mono", monospace;
}

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

@media (max-width: 1024px) {
  .hero-content,
  .cta-content {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hero-visual {
    order: -1;
    max-width: 100%;
  }

  .hero-title {
    font-size: 3rem;
  }

  /* Slow down glitch animation on tablet */
  .glitch::before {
    animation: glitch-anim 12s infinite linear alternate-reverse;
  }

  .glitch::after {
    animation: glitch-anim2 12s infinite linear alternate-reverse;
  }

  .feature-card.featured {
    grid-column: span 1;
  }

  .hero-stats {
    gap: 1.5rem;
    padding: 1.5rem;
  }

  .stat-item {
    min-width: 100px;
  }
}

@media (max-width: 768px) {
  .hero-section {
    padding: 1rem 0 3rem;
    min-height: auto;
  }

  /* Slow down glitch animation on mobile for better readability */
  .glitch::before {
    animation: glitch-anim 15s infinite linear alternate-reverse;
    clip: rect(0px, 9999px, 9999px, 0);
  }

  .glitch::after {
    animation: glitch-anim2 15s infinite linear alternate-reverse;
    clip: rect(0px, 9999px, 9999px, 0);
  }

  .hero-stats {
    gap: 0.75rem;
    padding: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
  }

  .stat-item {
    min-width: 70px;
    flex: 0 0 auto;
  }

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

  .stat-label {
    font-size: 0.75rem;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .hero-ctas {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .section-title {
    font-size: 2rem;
  }

  .features-grid,
  .latest-grid {
    grid-template-columns: 1fr;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .scroll-indicator {
    display: none;
  }

  .cta-title {
    font-size: 2rem;
  }
}

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

  .hero-title {
    font-size: 1.75rem;
  }

  .hero-stats {
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .stat-item {
    min-width: 60px;
  }

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

  .stat-label {
    font-size: 0.7rem;
  }

  .terminal-body {
    font-size: 0.75rem;
    padding: 1rem;
  }
}
