/* ============================================================
   Y3K HERO SECTION — Three.js Neural Core Container
   ============================================================ */

.y3k-hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(
    ellipse at 50% 50%,
    var(--y3k-void-light) 0%,
    var(--y3k-void) 70%
  );
}

/* --- Three.js Canvas --- */
#y3k-neural-core {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* WebGL fallback gradient */
.y3k-hero--no-webgl {
  background:
    radial-gradient(circle at 30% 40%, rgba(0, 240, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(188, 19, 254, 0.06) 0%, transparent 50%),
    var(--y3k-void);
}

.y3k-hero--no-webgl #y3k-neural-core {
  display: none;
}

/* --- Two-column Layout: Portrait (1/3) | Terminal (2/3) --- */
.y3k-hero__split {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 2fr;
  align-items: stretch;
  gap: var(--y3k-space-xl);
  width: 100%;
  max-width: 1200px;
  padding-inline: var(--y3k-space-xl);
}

/* Column wrappers */
.y3k-hero__col {
  display: flex;
  align-items: center;
  justify-content: center;
}

.y3k-hero__col--portrait {
  justify-content: flex-end;
}

.y3k-hero__col--terminal {
  justify-content: flex-start;
}

/* (Text widget removed — content merged into terminal welcome message) */

/* --- 3D Portrait --- */
.y3k-hero__portrait-wrapper {
  flex: 0 0 auto;
  perspective: 1200px;
}

.y3k-hero__portrait {
  position: relative;
  width: 320px;
  height: 480px;
  border: 2px solid var(--y3k-cyan-dim);
  border-radius: var(--y3k-radius-lg);
  overflow: hidden;
  transition: transform 0.15s ease-out, box-shadow var(--y3k-duration) var(--y3k-ease);
  animation: y3k-portrait-float 6s ease-in-out infinite;
  will-change: transform;
}

.y3k-hero__portrait:hover {
  box-shadow: 0 0 40px var(--y3k-cyan-dim),
              0 20px 60px rgba(0, 0, 0, 0.4);
}

@keyframes y3k-portrait-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.y3k-hero__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(1) brightness(1.1) contrast(1.05);
  transition: filter var(--y3k-duration) var(--y3k-ease);
}

.y3k-hero__portrait:hover img {
  filter: grayscale(0.4) brightness(1.05) contrast(1.02);
}

/* Scanning line effect */
.y3k-hero__portrait-scanline {
  position: absolute;
  inset-inline: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--y3k-cyan) 50%,
    transparent 100%
  );
  opacity: 0.4;
  animation: y3k-scanline 4s linear infinite;
  pointer-events: none;
}

@keyframes y3k-scanline {
  0% { inset-block-start: -2px; }
  100% { inset-block-start: 100%; }
}

/* --- Scroll Indicator --- */
.y3k-hero__scroll-indicator {
  position: absolute;
  inset-block-end: 40px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--y3k-chrome-dim);
  font-family: var(--y3k-font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

[dir="rtl"] .y3k-hero__scroll-indicator {
  transform: translateX(50%);
}

.y3k-hero__scroll-indicator svg {
  width: 20px;
  height: 20px;
  animation: y3k-bounce 2s ease-in-out infinite;
  stroke: var(--y3k-cyan);
  fill: none;
  stroke-width: 2;
}

@keyframes y3k-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(8px); opacity: 1; }
}

/* --- Ambient Glow Orbs (pure CSS decoration) --- */
.y3k-hero__glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.y3k-hero__glow-orb--cyan {
  width: 400px;
  height: 400px;
  background: rgba(255, 184, 0, 0.06);
  inset-block-start: 10%;
  inset-inline-start: 15%;
  animation: y3k-drift 12s ease-in-out infinite alternate;
}

.y3k-hero__glow-orb--purple {
  width: 350px;
  height: 350px;
  background: rgba(255, 220, 100, 0.04);
  inset-block-end: 15%;
  inset-inline-end: 10%;
  animation: y3k-drift 15s ease-in-out infinite alternate-reverse;
}

@keyframes y3k-drift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(30px, -20px); }
}

/* ----------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------- */
@media (max-width: 689px) {
  .y3k-hero {
    min-height: 90vh;
    min-height: 90dvh;
  }

  .y3k-hero__split {
    grid-template-columns: 1fr;
    gap: var(--y3k-space-lg);
    padding-inline: var(--y3k-space-md);
  }

  .y3k-hero__col {
    justify-content: center !important;
  }

  .y3k-terminal {
    height: 320px;
  }

  .y3k-hero__portrait-wrapper {
    perspective: none;
  }

  .y3k-hero__portrait {
    width: 200px;
    height: 260px;
    animation: none;
  }

  .y3k-hero__scroll-indicator {
    inset-block-end: 24px;
  }

  .y3k-hero__glow-orb {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .y3k-hero__scroll-indicator svg,
  .y3k-hero__tagline::after,
  .y3k-hero__glow-orb {
    animation: none;
  }

  .y3k-hero__portrait {
    animation: none;
  }

  .y3k-hero__portrait-scanline {
    animation: none;
    opacity: 0.2;
    inset-block-start: 50%;
  }
}

/* ============================================================
   Y3K INTERACTIVE TERMINAL
   ============================================================ */

.y3k-terminal {
  position: relative;
  z-index: 10;
  width: 100%;
  display: flex;
  flex-direction: column;
  border-radius: var(--y3k-radius-lg);
  background: rgba(5, 10, 20, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 240, 255, 0.15);
  box-shadow:
    0 0 30px rgba(0, 240, 255, 0.08),
    0 20px 60px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  overflow: hidden;
  font-family: var(--y3k-font-mono);
  height: 480px;
  direction: ltr;
  text-align: left;
}

/* --- Terminal Header (macOS-style dots) --- */
.y3k-terminal__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(10, 22, 40, 0.6);
  border-block-end: 1px solid rgba(0, 240, 255, 0.08);
}

.y3k-terminal__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.y3k-terminal__dot--red    { background: #FF5F56; }
.y3k-terminal__dot--yellow { background: #FFBD2E; }
.y3k-terminal__dot--green  { background: #27C93F; }

.y3k-terminal__title {
  font-size: 0.7rem;
  color: var(--y3k-chrome-dim);
  letter-spacing: 0.05em;
  margin-inline-start: auto;
}

/* --- Terminal Body (output area) --- */
.y3k-terminal__body {
  padding: 16px;
  flex: 1 1 auto;
  overflow-y: auto;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--y3k-chrome);
  scroll-behavior: smooth;
}

/* Custom scrollbar for terminal */
.y3k-terminal__body::-webkit-scrollbar {
  width: 4px;
}

.y3k-terminal__body::-webkit-scrollbar-track {
  background: transparent;
}

.y3k-terminal__body::-webkit-scrollbar-thumb {
  background: var(--y3k-cyan-dim);
  border-radius: 2px;
}

.y3k-terminal__line {
  white-space: pre-wrap;
  word-break: break-word;
}

.y3k-terminal__prompt-echo {
  color: var(--y3k-chrome-dim);
  font-size: 0.72rem;
}

/* --- Terminal Input Line --- */
.y3k-terminal__input-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-block-start: 1px solid rgba(0, 240, 255, 0.06);
  background: rgba(5, 10, 20, 0.5);
}

.y3k-terminal__prompt {
  color: var(--y3k-cyan);
  font-size: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.y3k-terminal__input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--y3k-white);
  font-family: var(--y3k-font-mono);
  font-size: 0.78rem;
  caret-color: var(--y3k-cyan);
  padding: 0;
}

.y3k-terminal__input::placeholder {
  color: var(--y3k-chrome-dim);
  opacity: 0.5;
}

/* --- Terminal responsive --- */
@media (max-width: 689px) {
  .y3k-terminal {
    border-radius: var(--y3k-radius);
  }

  .y3k-terminal__body {
    max-height: 160px;
    font-size: 0.7rem;
    padding: 12px;
  }

  .y3k-terminal__prompt {
    font-size: 0.68rem;
  }

  .y3k-terminal__input {
    font-size: 0.7rem;
  }

  .y3k-terminal__dot {
    width: 10px;
    height: 10px;
  }
}

/* --- Light mode terminal overrides --- */
body.y3k-light-mode .y3k-terminal {
  background: rgba(240, 242, 245, 0.92);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.08),
    0 20px 60px rgba(0, 0, 0, 0.05);
}

body.y3k-light-mode .y3k-terminal__header {
  background: rgba(230, 232, 236, 0.8);
  border-color: rgba(0, 0, 0, 0.06);
}

body.y3k-light-mode .y3k-terminal__body {
  color: #4A4A5A;
}

body.y3k-light-mode .y3k-terminal__input {
  color: #1A1A2E;
}

body.y3k-light-mode .y3k-terminal__input-line {
  background: rgba(240, 242, 245, 0.6);
  border-color: rgba(0, 0, 0, 0.04);
}

/* Light mode for entire site when toggled via terminal */
body.y3k-light-mode {
  --y3k-void: #F0F2F5;
  --y3k-void-light: #E8EAEE;
  --y3k-void-mid: #D8DBE0;
  --y3k-white: #1A1A2E;
  --y3k-white-dim: rgba(26, 26, 46, 0.7);
  --y3k-chrome: #4A4A5A;
  --y3k-chrome-dim: #8A8A9A;
  --y3k-glass-bg: rgba(255, 255, 255, 0.75);
  --y3k-glass-bg-solid: rgba(255, 255, 255, 0.9);
  --y3k-glass-border: rgba(0, 0, 0, 0.08);
}
