:root {
  --bg: #08111f;
  --panel: rgba(15, 25, 45, 0.84);
  --panel-2: rgba(19, 34, 61, 0.92);
  --text: #ecf3ff;
  --muted: #b8c5dc;
  --accent: #77e8c6;
  --accent-2: #79a9ff;
  --danger: #ff8d8d;
  --line: rgba(255,255,255,0.09);
  --shadow: 0 20px 50px rgba(0,0,0,0.32);
  --radius: 24px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(119, 232, 198, 0.12), transparent 20%),
    radial-gradient(circle at top right, rgba(121, 169, 255, 0.13), transparent 24%),
    linear-gradient(180deg, #07101c 0%, #0b1422 100%);
}

a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }

.top-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 0%, rgba(121,169,255,0.08), transparent 32%);
}

.container {
  width: min(calc(100% - 28px), var(--max));
  margin: 0 auto;
}

.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
  background: rgba(7, 11, 20, 0.72);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand strong { display: block; }
.brand small { display: block; color: var(--muted); margin-top: 2px; }
.brand-box {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #08101a;
  font-weight: 800;
}

.nav-links,
.nav-actions,
.hero-actions,
.tool-actions,
.social-links,
.stats,
.link-list,
.chip-list,
.doc-head,
.doc-meta,
.chat-input-row,
.profile-mini-head {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--text); }

.btn {
  border: 1px solid transparent;
  border-radius: 14px;
  min-height: 46px;
  padding: 0 18px;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, border-color 0.18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07101b;
  font-weight: 700;
}
.btn.ghost {
  background: rgba(255,255,255,0.03);
  color: var(--text);
  border-color: var(--line);
}
.btn.small { min-height: 40px; padding: 0 14px; font-size: 0.94rem; }
.btn.full { width: 100%; }

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  padding: 38px 0 18px;
}

.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-profile,
.about-card,
.skills-card,
.social-card,
.tool-card,
.more-links,
.dashboard-guest,
.profile-mini,
.tool-live,
.doc-chat-card,
.admin-card,
.modal-card {
  padding: 24px;
}

.pill,
.mini-label,
.status,
.future-link,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
}
.pill, .mini-label {
  color: var(--accent);
  background: rgba(119,232,198,0.08);
  padding: 8px 12px;
  font-size: 0.86rem;
}
.mini-label { width: fit-content; }
.hero-copy h1 {
  font-size: clamp(2rem, 4.2vw, 3.7rem);
  line-height: 1.05;
  margin: 14px 0 12px;
}
.hero-copy h1 span { color: var(--accent); }
.lead, .summary, .muted, .section-note, .tool-card p, .small-text { color: var(--muted); }
.stats { margin-top: 26px; }
.stats > div {
  flex: 1 1 190px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
}
.stats strong { display: block; margin-bottom: 4px; }

.hero-profile {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.profile-photo {
  width: 132px;
  height: 132px;
  object-fit: cover;
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,0.14);
}
.role { margin-top: 6px; font-weight: 600; color: #d8e8ff; }
.chip-list { margin-top: 12px; }
.chip {
  padding: 9px 12px;
  background: rgba(255,255,255,0.04);
  color: #dfe9ff;
  font-size: 0.93rem;
}

.section-space { padding: 22px 0; }
.profile-grid,
.tool-grid,
.dashboard-grid,
.admin-grid {
  display: grid;
  gap: 18px;
}
.profile-grid {
  grid-template-columns: repeat(3, 1fr);
}
.tool-grid { grid-template-columns: repeat(4, 1fr); }
.dashboard-grid { grid-template-columns: repeat(2, 1fr); }
.admin-grid { grid-template-columns: repeat(2, 1fr); }
.full-span { grid-column: 1 / -1; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.section-heading.compact { margin-bottom: 18px; }
.section-heading h3, .section-heading h4, .tool-card h4, .hero-profile h2, .about-card h3, .skills-card h3, .social-card h3 { margin: 6px 0 0; }
.tool-card.disabled { opacity: 0.72; }
.tool-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.tool-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(119,232,198,0.14), rgba(121,169,255,0.18));
  border: 1px solid rgba(255,255,255,0.08);
}
.status { padding: 7px 10px; font-size: 0.84rem; }
.status.on, .future-link.on { color: #8cf4b9; background: rgba(121,240,167,0.08); }
.status.off, .future-link.off { color: #ffc67e; background: rgba(243,201,107,0.08); }
.more-links { margin-top: 18px; }
.link-list { margin-top: 12px; }
.future-link { padding: 8px 12px; }
.social-links a {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}
.contact-mail { margin-top: 14px; }

.hidden { display: none !important; }
.profile-mini-photo {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  object-fit: cover;
}
.tool-textarea, textarea, input, select {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  border-radius: 14px;
  padding: 13px 14px;
}
label { display: grid; gap: 8px; }
label span { color: var(--muted); font-size: 0.92rem; }
.video-box {
  width: 100%;
  min-height: 260px;
  border-radius: 18px;
  background: #050a12;
  border: 1px solid var(--line);
}
.placeholder-box {
  min-height: 110px;
  border-radius: 18px;
  padding: 16px;
  border: 1px dashed rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
}
.upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07101a;
  font-weight: 700;
}
.chat-box {
  min-height: 280px;
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  border-radius: 18px;
  padding: 14px;
  display: grid;
  gap: 12px;
}
.chat-message {
  max-width: 85%;
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.5;
}
.chat-message.ai {
  background: rgba(121,169,255,0.12);
  border: 1px solid rgba(121,169,255,0.18);
}
.chat-message.user {
  justify-self: end;
  background: rgba(119,232,198,0.12);
  border: 1px solid rgba(119,232,198,0.18);
}
.download-link {
  color: var(--accent);
  display: inline-block;
  margin-top: 8px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 14, 0.76);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 50;
}
.modal-card {
  width: min(100%, 440px);
  position: relative;
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  cursor: pointer;
}
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(14, 24, 43, 0.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.admin-tools-block {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}
.admin-tools-block label {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 1100px) {
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .hero,
  .profile-grid,
  .dashboard-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }
  .nav {
    min-height: auto;
    padding: 14px 0;
    flex-wrap: wrap;
  }
  .nav-links { order: 3; width: 100%; }
}

@media (max-width: 640px) {
  .tool-grid { grid-template-columns: 1fr; }
  .hero-copy, .hero-profile, .about-card, .skills-card, .social-card, .tool-card, .more-links,
  .dashboard-guest, .profile-mini, .tool-live, .doc-chat-card, .admin-card, .modal-card {
    padding: 18px;
  }
  .hero-copy h1 { font-size: 2rem; }
  .profile-photo { width: 108px; height: 108px; }
  .video-box { min-height: 210px; }
  .toast { left: 14px; right: 14px; max-width: none; }
}
