/* ===========================================================
   NEXUS_OS — Futuristic OS UI
   =========================================================== */
:root {
  --bg: #0a0a0f;
  --bg-2: #0e0e16;
  --panel: #11121b;
  --panel-2: #161826;
  --accent: #00f5a0;
  --accent-dim: #00b377;
  --accent-glow: rgba(0, 245, 160, 0.35);
  --text: #d8f5ea;
  --text-dim: #6f8a82;
  --border: rgba(0, 245, 160, 0.18);
  --danger: #ff5f56;
  --warn: #ffbd2e;
  --ok: #27c93f;
  --mono: 'JetBrains Mono', 'Share Tech Mono', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

::selection { background: var(--accent); color: #00130c; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--accent-dim); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ===================== BOOT SCREEN ===================== */
.boot-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease;
}
.boot-screen.fade-out { opacity: 0; pointer-events: none; }
.boot-inner { width: min(620px, 90vw); }
.boot-log {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  white-space: pre-wrap;
  min-height: 200px;
  text-shadow: 0 0 8px var(--accent-glow);
}
.boot-log .dim { color: var(--text-dim); }
.boot-bar-wrap {
  margin-top: 18px;
  height: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.boot-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  box-shadow: 0 0 12px var(--accent-glow);
  transition: width 0.2s linear;
}
.boot-percent {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: right;
}

/* ===================== OS / DESKTOP ===================== */
.os { position: relative; min-height: 100vh; }

.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.25;
  z-index: 0;
  animation: gridmove 20s linear infinite;
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 80%);
          mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 80%);
}
@keyframes gridmove { from { background-position: 0 0; } to { background-position: 40px 40px; } }

.scanline {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(rgba(0,245,160,0.03) 50%, transparent 50%);
  background-size: 100% 4px;
}

/* ===================== TOP BAR ===================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  background: rgba(14, 14, 22, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  flex-wrap: wrap;
}
.topbar-left { display: flex; align-items: center; gap: 8px; }
.logo-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px var(--accent);
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.brand { font-weight: 800; color: var(--accent); letter-spacing: 1px; }
.topbar-sep, .topbar-path { color: var(--text-dim); }
.topbar-nav { display: flex; gap: 18px; }
.topbar-nav a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.2s;
  position: relative;
}
.topbar-nav a:hover { color: var(--accent); text-shadow: 0 0 8px var(--accent-glow); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.lang-toggle {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: var(--mono);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: all 0.2s;
}
.lang-toggle:hover { background: var(--accent); color: #00130c; box-shadow: 0 0 12px var(--accent-glow); }
.clock { color: var(--accent); font-variant-numeric: tabular-nums; }

/* ===================== CONTENT ===================== */
.content { position: relative; z-index: 2; max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ===================== HERO ===================== */
.hero {
  min-height: calc(100vh - 50px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  text-align: start;
}
.terminal-window {
  width: 100%;
  max-width: 680px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(0,245,160,0.08), inset 0 0 60px rgba(0,245,160,0.03);
  overflow: hidden;
}
.tw-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.tw-btn { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.tw-btn.red { background: var(--danger); }
.tw-btn.yellow { background: var(--warn); }
.tw-btn.green { background: var(--ok); }
.tw-title { margin-inline-start: 10px; color: var(--text-dim); font-size: 0.8rem; }
.tw-body { padding: 22px; direction: ltr; text-align: left; min-height: 230px; }
.prompt-line { color: var(--text-dim); margin-top: 10px; }
.prompt { color: var(--accent); margin-inline-end: 6px; }
.cmd { color: var(--text); }
.hero-name {
  font-size: clamp(1.6rem, 5vw, 2.8rem);
  font-weight: 800;
  color: var(--accent);
  text-shadow: 0 0 16px var(--accent-glow);
  margin: 6px 0;
  min-height: 1.2em;
}
.hero-role { color: var(--text); font-size: clamp(0.9rem, 2.5vw, 1.15rem); min-height: 1.2em; }
.blink-cursor { color: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-hint {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-dim); font-size: 0.85rem;
  animation: floaty 2s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ===================== SECTIONS ===================== */
.section { padding: 70px 0; }
.section-title {
  font-size: clamp(1.3rem, 4vw, 2rem);
  color: var(--accent);
  display: flex; align-items: center; gap: 12px;
  text-shadow: 0 0 12px var(--accent-glow);
}
.section-sub { color: var(--text-dim); margin: 8px 0 28px; font-size: 0.9rem; }

/* ===================== PROJECTS / FOLDERS ===================== */
.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 18px;
}
.folder {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
  position: relative;
  overflow: hidden;
}
.folder::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, var(--accent-glow), transparent 70%);
  opacity: 0; transition: opacity 0.3s;
}
.folder:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(0,245,160,0.15);
}
.folder:hover::before { opacity: 0.4; }
.folder-icon {
  font-size: 2.6rem; color: var(--accent);
  margin-bottom: 12px; position: relative; z-index: 1;
  filter: drop-shadow(0 0 10px var(--accent-glow));
}
.folder-name { font-weight: 700; position: relative; z-index: 1; }
.folder-file { color: var(--text-dim); font-size: 0.75rem; margin-top: 4px; position: relative; z-index: 1; }

/* ===================== SKILLS / APPS ===================== */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.app {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.app:hover { border-color: var(--accent); box-shadow: 0 0 20px rgba(0,245,160,0.1); }
.app-top { display: flex; align-items: center; gap: 12px; }
.app-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 1.3rem;
  filter: drop-shadow(0 0 6px var(--accent-glow));
}
.app-name { font-weight: 700; flex: 1; }
.app-pct { color: var(--accent); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.app-bar-wrap {
  height: 8px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
}
.app-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  box-shadow: 0 0 10px var(--accent-glow);
  transition: width 1.2s cubic-bezier(.2,.8,.2,1);
}

/* ===================== CONTACT / CRYPTO FORM ===================== */
.crypto-form {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px;
  max-width: 620px;
  box-shadow: inset 0 0 60px rgba(0,245,160,0.03);
}
.field { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.field label { color: var(--text-dim); font-size: 0.85rem; }
.field input, .field textarea {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono);
  padding: 12px;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.encode-preview {
  min-height: 0; height: 0; overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--accent);
  font-size: 0.72rem;
  word-break: break-all;
  white-space: pre-wrap;
  opacity: 0;
  transition: opacity 0.3s, height 0.3s, padding 0.3s;
  padding: 0 12px;
}
.encode-preview.show {
  height: auto; min-height: 60px; max-height: 140px; overflow-y: auto;
  opacity: 1; padding: 12px; margin-bottom: 16px;
}
.send-btn {
  width: 100%;
  background: var(--accent);
  color: #00130c;
  border: none;
  border-radius: 8px;
  font-family: var(--mono);
  font-weight: 800;
  padding: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: box-shadow 0.2s, transform 0.1s, opacity 0.2s;
}
.send-btn:hover { box-shadow: 0 0 22px var(--accent-glow); }
.send-btn:active { transform: scale(0.98); }
.send-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.form-status { margin-top: 14px; min-height: 1.2em; color: var(--accent); font-size: 0.85rem; text-align: center; }

/* ===================== FOOTER ===================== */
.footer {
  position: relative; z-index: 2;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.78rem;
  padding: 26px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
}
.footer-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ===================== MODAL ===================== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5,5,9,0.8);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-window {
  width: min(560px, 95vw);
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 0 50px rgba(0,245,160,0.25);
  overflow: hidden;
  animation: modalpop 0.25s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes modalpop { from { transform: scale(0.85) translateY(20px); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-x {
  margin-inline-start: auto;
  background: transparent; border: none; color: var(--text-dim);
  cursor: pointer; font-size: 1rem; transition: color 0.2s;
}
.modal-x:hover { color: var(--danger); }
.modal-body { padding: 24px; }
.modal-icon { font-size: 3rem; color: var(--accent); filter: drop-shadow(0 0 12px var(--accent-glow)); margin-bottom: 12px; }
.modal-name { font-size: 1.4rem; color: var(--accent); font-weight: 800; margin-bottom: 6px; }
.modal-desc { color: var(--text); margin: 14px 0; font-size: 0.92rem; line-height: 1.8; }
.modal-meta { display: flex; gap: 24px; flex-wrap: wrap; margin: 16px 0; }
.modal-meta-item { font-size: 0.85rem; }
.modal-meta-item .k { color: var(--text-dim); display: block; margin-bottom: 4px; }
.modal-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.modal-tag {
  background: var(--panel-2); border: 1px solid var(--border);
  color: var(--accent); font-size: 0.75rem;
  padding: 4px 10px; border-radius: 20px;
}
.modal-open-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid var(--accent); color: var(--accent);
  padding: 10px 18px; border-radius: 8px; text-decoration: none;
  font-family: var(--mono); transition: all 0.2s; margin-top: 8px;
}
.modal-open-btn:hover { background: var(--accent); color: #00130c; box-shadow: 0 0 16px var(--accent-glow); }

/* ===================== REVEAL ANIMATION ===================== */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.6s, transform 0.6s; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 640px) {
  .topbar-nav { display: none; }
  .tw-body { padding: 16px; }
  .section { padding: 50px 0; }
}

/* ===== CONTACT DIRECT BUTTONS ===== */
.contact-direct {
  margin-top: 1.5rem;
}

#contact-btns {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.4rem;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  cursor: pointer;
}

.contact-btn:hover {
  transform: translateY(-2px);
}

.whatsapp-btn {
  color: #00f5a0;
  border-color: #00f5a0;
  background: rgba(0, 245, 160, 0.07);
}

.whatsapp-btn:hover {
  background: rgba(0, 245, 160, 0.18);
}

.telegram-btn {
  color: #38b6ff;
  border-color: #38b6ff;
  background: rgba(56, 182, 255, 0.07);
}

.telegram-btn:hover {
  background: rgba(56, 182, 255, 0.18);
}

.contact-btn i {
  font-size: 1.1rem;
}