/* ============================================================
   CODECHOMPER V2 — Home Page
   Hero · Featured Works · About
   ============================================================ */


/* ============================
   HERO SECTION
   Design ref: pXNRx — 700px, full-bleed bg image
   ============================ */

.hero {
  position: relative;
  width: 100%;
  height: 700px;
  overflow: hidden;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  display: flex;
  justify-content: center;
}

/* Centered inner wrapper — caps content width, bg stays full-bleed */
.hero-inner {
  display: flex;
  width: 100%;
  max-width: var(--container-max);
  height: 100%;
}

/* Dark gradient fade — bottom of hero */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    #080808FF 0%,
    #08080800 94%
  );
  z-index: 1;
  pointer-events: none;
}

/* --- Hero Left Column (text) --- */
.hero-left {
  position: relative;
  z-index: 2;
  width: 700px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 80px 72px;
}

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

.hero-line {
  font-family: var(--font-primary);
  font-size: clamp(56px, 6.67vw, 96px);
  line-height: 1.0;
  letter-spacing: -0.01em;
}

.hero-line--white  { color: var(--foreground); }
.hero-line--green  { color: var(--primary); }
.hero-line--orange { color: var(--accent); }

.hero-subhead {
  font-family: var(--font-secondary);
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted-foreground);
  max-width: 520px;
}

/* CTA row */
.hero-cta-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-m);
  flex-wrap: wrap;
}

/* Stats row */
.hero-stats-row {
  display: flex;
  align-items: center;
  gap: 0;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: var(--spacing-xl);
}

.hero-stat:not(:first-child) {
  padding-left: var(--spacing-xl);
}

.hero-stat-num {
  font-family: var(--font-primary);
  font-size: 28px;
  color: var(--foreground);
  line-height: 1;
}

.hero-stat-suffix {
  font-family: var(--font-primary);
  font-size: 22px;
  color: var(--primary);
}

.hero-stat-label {
  font-family: var(--font-secondary);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.hero-stat-divider {
  width: 1px;
  height: 36px;
  background-color: var(--border);
  flex-shrink: 0;
}

/* --- Hero Right Column (visual) --- */
.hero-right {
  position: relative;
  z-index: 2;
  flex: 1;
  overflow: hidden;
}

/* Orange top accent bar */
.hero-top-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--accent);
}

/* Ghost "CC" text */
.hero-ghost-cc {
  position: absolute;
  top: 49px;
  left: 30px;
  font-family: var(--font-primary);
  font-size: clamp(200px, 27.8vw, 400px);
  line-height: 1;
  color: rgba(136, 255, 0, 0.32);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

/* Glitch horizontal bars */
.hero-glitch-lines {
  position: absolute;
  top: 58px;
  left: 0;
  right: 0;
  pointer-events: none;
}

.hero-glitch-bar {
  position: absolute;
  height: 3px;
}

.hero-glitch-bar:nth-child(1) {
  width: 200px;
  left: 420px;
  top: 0;
  background-color: var(--accent);
  opacity: 0.9;
  animation: glitch-bar-flicker 2.8s ease-in-out infinite;
}

.hero-glitch-bar:nth-child(2) {
  width: 100px;
  left: 360px;
  top: 24px;
  background-color: var(--primary);
  opacity: 0.7;
  animation: glitch-bar-flicker-2 2.2s ease-in-out infinite;
  animation-delay: 0.4s;
}

.hero-glitch-bar:nth-child(3) {
  width: 60px;
  left: 480px;
  top: 44px;
  background-color: var(--accent);
  opacity: 0.5;
  animation: glitch-bar-flicker 3.4s ease-in-out infinite;
  animation-delay: 1s;
}

/* Terminal window */
.hero-terminal {
  position: absolute;
  left: 92px;
  top: 444px;
  width: min(500px, calc(100% - 92px - 24px));
  background-color: var(--bg-elevated);
  border: 1px solid var(--primary);
  overflow: hidden;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: var(--spacing-s);
  padding: 10px 16px;
  background-color: #0a0a0a;
  border-bottom: 1px solid var(--border);
}

.term-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.term-dot:nth-child(1) { background-color: var(--destructive); }
.term-dot:nth-child(2) { background-color: var(--accent); }
.term-dot:nth-child(3) { background-color: var(--primary); }

.term-path {
  font-family: var(--font-secondary);
  font-size: 11px;
  color: var(--muted-foreground);
  letter-spacing: 0.05em;
  margin-left: 4px;
}

.term-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px 20px;
  background-color: #080808;
  min-height: 130px;
}

.term-line {
  font-family: var(--font-secondary);
  font-size: 12px;
  color: var(--foreground);
  line-height: 1.5;
  opacity: 0;
  transition: opacity 0.15s ease;
  white-space: nowrap;
}

.term-line.is-visible {
  opacity: 1;
}

.term-line--muted   { color: var(--muted-foreground); }
.term-line--primary { color: var(--primary); }
.term-line--accent  { color: var(--accent); }
.term-line--divider {
  color: var(--border);
  letter-spacing: 0;
}

/* Coordinate strip */
.hero-coords {
  position: absolute;
  bottom: 30px;
  left: 110px;
  font-family: var(--font-secondary);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--border);
  white-space: nowrap;
}

/* --- Hero responsive --- */
@media (max-width: 1024px) {
  .hero {
    height: auto;
    /* Don't clip the stacked right column — hero-right clips its own overflow */
    overflow: visible;
  }

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

  .hero-left {
    width: 100%;
    padding: 60px 40px 40px;
    gap: 24px;
  }

  /* hero-right becomes a flex column so the terminal flows naturally */
  .hero-right {
    position: relative;
    height: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 40px 40px;
    /* Clip only the decorative absolute elements (ghost CC, glitch bars) */
    overflow: hidden;
    /* Give it a visual minimum so the bg image shows even if terminal is short */
    min-height: 220px;
  }

  .hero-ghost-cc {
    font-size: 240px;
    top: -20px;
    left: 10px;
  }

  /* Remove absolute positioning so the terminal is a normal flex child */
  .hero-terminal {
    position: relative;
    left: auto;
    top: auto;
    bottom: auto;
    width: 100%;
  }

  .hero-coords {
    display: none;
  }
}

@media (max-width: 768px) {
  .hero-left {
    padding: 48px var(--spacing-l) 32px;
  }

  .hero-line {
    font-size: clamp(48px, 14vw, 72px);
  }

  .hero-stats-row {
    flex-wrap: wrap;
    gap: var(--spacing-l);
  }

  .hero-stat-divider {
    display: none;
  }

  .hero-stat {
    padding: 0;
  }

  .hero-right {
    padding: 0 var(--spacing-l) var(--spacing-l);
  }

  /* terminal already position: relative from 1024px rule — just tighten padding */
  .hero-terminal {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .hero-cta-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-cta-row .btn {
    width: 100%;
    justify-content: center;
  }
}


/* ============================
   FEATURED WORKS SECTION
   Design ref: SkNLv — padding 80, gap 56
   ============================ */

.featured-works {
  display: flex;
  flex-direction: column;
  gap: 56px;
  padding: 80px;
  background-color: var(--background);
  max-width: var(--container-max);
  margin-inline: auto;
  width: 100%;
}

.featured-works-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-l);
  width: 100%;
}

.featured-works-cta {
  display: flex;
  justify-content: center;
  padding: 16px 0;
}

/* Staggered card entrance */
.featured-works-cards .card:nth-child(1) { --delay: 0s; }
.featured-works-cards .card:nth-child(2) { --delay: 0.1s; }
.featured-works-cards .card:nth-child(3) { --delay: 0.2s; }

/* Responsive featured works */
@media (max-width: 1024px) {
  .featured-works {
    padding: 60px 40px;
  }
}

@media (max-width: 768px) {
  .featured-works {
    padding: 48px var(--spacing-l);
    gap: 40px;
  }

  .featured-works-cards {
    grid-template-columns: 1fr;
  }
}


/* ============================
   ABOUT SECTION
   Design ref: f6sQP
   ============================ */

.about-section {
  display: flex;
  flex-direction: column;
  background-color: var(--background);
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
}

/* About header */
.about-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-m);
  height: 151px;
  padding: 80px 80px 40px;
}

.about-header-text .section-overline {
  color: var(--primary);
  font-family: var(--font-primary);
  font-weight: normal;
}

/* About body — 2 columns */
.about-body {
  display: flex;
  gap: 80px;
  padding: 60px 80px;
}

/* Left column */
.about-left {
  display: flex;
  flex-direction: column;
  gap: 32px;
  flex: 1;
  min-width: 0;
}

.about-pullquote {
  font-family: var(--font-primary);
  font-size: clamp(28px, 3.33vw, 48px);
  line-height: 1.1;
  color: var(--foreground);
}

.about-bio {
  font-family: var(--font-secondary);
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted-foreground);
}

/* Focus areas */
.focus-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-m);
}

.focus-heading {
  font-family: var(--font-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary);
}

.focus-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-s);
}

.focus-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-m);
  font-family: var(--font-secondary);
  font-size: 14px;
  color: var(--muted-foreground);
}

.focus-item::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--primary);
  flex-shrink: 0;
}

/* Right column */
.about-right {
  display: flex;
  flex-direction: column;
  width: 480px;
  flex-shrink: 0;
}

.about-photo-accent {
  width: 100%;
  height: 3px;
  background-color: var(--primary);
  flex-shrink: 0;
}

.about-photo-wrapper {
  position: relative;
  height: 540px;
  overflow: hidden;
  flex-shrink: 0;
}

.about-photo-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.5s ease;
}

.about-photo-wrapper:hover img {
  transform: scale(1.03);
}

.about-photo-caption {
  display: flex;
  align-items: center;
  gap: var(--spacing-s);
  padding-top: 12px;
}

.about-caption-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background-color: var(--primary);
  font-family: var(--font-primary);
  font-size: 9px;
  color: var(--primary-foreground);
  flex-shrink: 0;
}

.about-caption-text {
  font-family: var(--font-secondary);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

/* Responsive about */
@media (max-width: 1024px) {
  .about-header {
    padding: 60px 40px 32px;
    height: auto;
  }

  .about-body {
    padding: 40px 40px;
    gap: 48px;
  }

  .about-right {
    width: 360px;
  }

  .about-photo-wrapper {
    height: 420px;
  }
}

@media (max-width: 768px) {
  .about-header {
    padding: 48px var(--spacing-l) 24px;
  }

  .about-body {
    flex-direction: column;
    padding: 32px var(--spacing-l) 48px;
    gap: var(--spacing-xxl);
  }

  .about-right {
    width: 100%;
  }

  /* Let the image determine the height — no cropping */
  .about-photo-wrapper {
    height: auto;
  }

  .about-photo-wrapper img {
    object-fit: contain;
    object-position: top center;
    height: auto;
    width: 100%;
  }

  .about-pullquote {
    font-size: clamp(24px, 7vw, 36px);
  }
}
