:root {
  --bg: #050c14;
  --surface: #0a1520;
  --border: #0f2234;
  --accent: #00c8ff;
  --accent2: #0056a8;
  --muted: #2a4a6a;
  --text: #c8dce8;
  --text-dim: #5a7a90;
  --green: #00ff9d;
  --red: #ff4455;
  --font-mono: 'JetBrains Mono', monospace;
  --font-alt: 'Space Mono', monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scanline overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 200, 255, 0.012) 2px,
    rgba(0, 200, 255, 0.012) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* Grid noise bg */
.noise-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(0, 200, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 200, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* TOP BAR */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 48px;
  font-size: 11px;
  color: var(--text-dim);
}

.topbar .logo {
  color: var(--accent);
  letter-spacing: 0.12em;
  font-weight: 700;
}

.topbar .status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

/* HERO */
.hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: start;
  margin-bottom: 52px;
}

.avatar {
  width: 80px;
  height: 80px;
  border: 1px solid var(--muted);
  background: var(--surface);
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 200, 255, 0.15), transparent 60%);
}

/* ASCII-art avatar placeholder */
.avatar-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--accent);
  font-family: var(--font-alt);
  user-select: none;
}

.hero-name {
  font-family: var(--font-alt);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.hero-intro {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-size: 10px;
  border: 1px solid var(--muted);
  color: var(--text-dim);
  padding: 2px 8px;
  letter-spacing: 0.08em;
  transition: border-color 0.2s, color 0.2s;
}

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

/* SECTION */
.section {
  margin-bottom: 48px;
}

.section-label {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  text-transform: uppercase;
  border-left: 2px solid var(--accent);
  padding-left: 8px;
  margin-bottom: 18px;
}

/* INFO GRID */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.info-cell {
  background: var(--surface);
  padding: 14px 16px;
}

.info-key {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.info-val {
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
}

.info-val.accent {
  color: var(--accent);
}

.info-cell.full {
  grid-column: 1 / -1;
}

/* PROJECT IMAGES */
.project-content {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  justify-content: space-between;
  margin-top: 8px; /* space between key and val */
}

.project-desc {
  flex: 1;
}

.project-img {
  max-width: 45%; 
  height: auto;
  border: 1px solid var(--border);
  display: block;
  object-fit: contain;
}

/* DIGITAL TWIN CHAT */
.chat-wrapper {
  border: 1px solid var(--muted);
  background: var(--surface);
  box-shadow: 0 0 15px rgba(0, 200, 255, 0.05);
  position: relative;
}

.chat-wrapper::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.chat-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  background: var(--bg);
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-title {
  color: var(--accent);
  letter-spacing: 0.1em;
}

.chat-subtitle {
  color: var(--text-dim);
  font-size: 10px;
}

.chat-log {
  height: 320px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--muted) transparent;
}

.msg {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  max-width: 100%;
  animation: fadeSlide 0.25s ease;
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.msg.user {
  direction: rtl;
}

.msg.user > * {
  direction: ltr;
}

.msg-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border: 1px solid var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--text-dim);
}

.msg.user .msg-icon {
  border-color: var(--accent2);
  color: var(--accent);
}

.msg-body {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  max-width: calc(100% - 34px);
}

.msg.user .msg-body {
  background: #051a2e;
  border-color: var(--accent2);
  color: #9fd6f0;
}

.msg-body .typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.msg-body .typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1s ease-in-out infinite;
}

.msg-body .typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.msg-body .typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0.2;
  }

  40% {
    opacity: 1;
  }
}

/* Quick question chips */
.chips {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  font-size: 10px;
  padding: 4px 10px;
  border: 1px solid var(--muted);
  color: var(--text-dim);
  cursor: pointer;
  background: transparent;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  transition: all 0.15s;
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 200, 255, 0.05);
}

.chip:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.chat-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  border-top: 1px solid var(--border);
}

.chat-input {
  background: transparent;
  border: none;
  outline: none;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  caret-color: var(--accent);
}

.chat-input::placeholder {
  color: var(--text-dim);
}

.chat-send {
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  padding: 12px 16px;
  cursor: pointer;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  transition: color 0.15s, background 0.15s;
}

.chat-send:hover {
  color: var(--accent);
  background: rgba(0, 200, 255, 0.05);
}

.chat-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* FOOTER */
footer {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* RESPONSIVE */
@media (max-width: 540px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .avatar {
    width: 60px;
    height: 60px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .info-cell.full {
    grid-column: auto;
  }

  .project-content {
    flex-direction: column;
  }

  .project-img {
    max-width: 100%;
    margin-top: 14px;
  }

  .hero-name {
    font-size: 18px;
  }

  .chat-log {
    height: 260px;
  }
}
