:root {
  --bg: #070d12;
  --surface: #0d1720;
  --surface-2: #111f2b;
  --surface-3: #162938;
  --ink: #eef6f4;
  --muted: #8ea19c;
  --soft: #c8d7d2;
  --line: rgba(200, 215, 210, 0.11);
  --line-strong: rgba(115, 231, 186, 0.2);
  --accent: #73e7ba;
  --accent-2: #42c8e8;
  --blue: #4f8cff;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(66, 200, 232, 0.11), transparent 32%),
    linear-gradient(300deg, rgba(115, 231, 186, 0.09), transparent 36%),
    var(--bg);
  transition: background-color 180ms ease, color 180ms ease;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background-image:
    linear-gradient(rgba(200, 215, 210, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200, 215, 210, 0.045) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  color: var(--ink);
  background: var(--bg);
  transition: opacity 220ms ease, visibility 220ms ease;
}

.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loader span {
  width: 42px;
  height: 42px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

.loader p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.app {
  display: grid;
  grid-template-columns: minmax(300px, 370px) minmax(0, 1fr);
  gap: 24px;
  width: min(1200px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 52px;
}

.profile-card,
.control-panel,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.24);
}

.profile-card {
  position: sticky;
  top: 24px;
  align-self: start;
  display: grid;
  gap: 18px;
  padding: 18px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(115, 231, 186, 0.08), transparent 45%),
    var(--surface);
}

.profile-card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.profile-card__media::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(to top, rgba(7, 13, 18, 0.5), transparent 46%);
}

.profile-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: contrast(1.04) saturate(0.92) brightness(0.92);
}

.profile-card__body h1 {
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 4rem);
  line-height: 1;
}

.profile-card__body p:not(.eyebrow) {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.profile-card__body .tagline {
  margin-top: 10px;
  color: var(--accent);
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.profile-status {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-status div {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.profile-status span {
  color: var(--muted);
  font-size: 0.82rem;
}

.profile-status strong {
  color: var(--accent);
}

.content {
  display: grid;
  gap: 20px;
}

.control-panel {
  position: sticky;
  top: 24px;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px;
  background: rgba(13, 23, 32, 0.84);
  backdrop-filter: blur(16px);
}

.control-btn,
.button,
.record-row button,
.icon-copy,
.qr-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.control-btn:hover,
.button:hover,
.icon-copy:hover,
.qr-toggle:hover {
  transform: translateY(-2px);
}

.control-btn:focus-visible,
.button:focus-visible,
.icon-copy:focus-visible,
.qr-toggle:focus-visible,
.module-link:focus-visible {
  outline: 3px solid rgba(66, 200, 232, 0.34);
  outline-offset: 3px;
}

.button--primary {
  color: #06100d;
  background: var(--accent);
  border-color: var(--accent);
}

.button--ghost:hover,
.control-btn:hover,
.qr-toggle:hover {
  color: #06100d;
  background: var(--accent);
}

.panel {
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent),
    rgba(13, 23, 32, 0.9);
}

body.light .panel {
  background: rgba(255, 255, 255, 0.92);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: 18px;
  margin-bottom: 20px;
}

.section-head h2,
.project-card h3 {
  margin: 0;
  line-height: 1.05;
}

.section-head h2 {
  font-size: clamp(1.65rem, 3vw, 2.8rem);
}

.about-text {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.7vw, 1.14rem);
  line-height: 1.8;
}

.academic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.academic-grid article {
  display: grid;
  gap: 7px;
  min-height: 92px;
  padding: 15px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.academic-grid span {
  color: var(--muted);
  font-size: 0.86rem;
}

.academic-grid strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.search-box {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.search-box span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.search-box input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
}

.search-box input:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(66, 200, 232, 0.16);
}

.module-list,
.record-list,
.skill-list {
  display: grid;
  gap: 10px;
}

.module-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 88px;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent-color, var(--accent));
  border-radius: var(--radius);
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.module-row:hover,
.module-row.dragging {
  transform: translateY(-2px);
  background: var(--surface-3);
  border-color: var(--line-strong);
}

.module-row.was-moved {
  animation: moved 380ms ease;
}

@keyframes moved {
  0% {
    box-shadow: 0 0 0 0 rgba(115, 231, 186, 0.36);
  }

  100% {
    box-shadow: 0 0 0 12px rgba(115, 231, 186, 0);
  }
}

.module-link {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 66px;
  padding: 8px;
  border-radius: var(--radius);
}

.module-link img {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.24));
}

.text-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  color: #06100d;
  font-weight: 950;
  background: var(--accent);
  border-radius: var(--radius);
}

.module-link span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.module-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.module-link strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  text-transform: uppercase;
}

.priority-badge {
  padding: 3px 7px;
  color: #06100d;
  font-size: 0.68rem;
  font-weight: 950;
  background: var(--accent);
  border-radius: 999px;
  text-transform: uppercase;
}

.module-link small,
.project-card p,
.qr-card span {
  color: var(--muted);
}

.module-actions {
  display: grid;
  grid-template-columns: repeat(2, 46px);
  align-content: center;
  gap: 8px;
}

.icon-copy,
.qr-toggle {
  width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  color: var(--accent);
  background: rgba(115, 231, 186, 0.08);
  border-color: rgba(115, 231, 186, 0.16);
}

.icon-copy:hover,
.qr-toggle:hover {
  color: #06100d;
  background: var(--accent);
}

.icon-copy svg {
  width: 21px;
  height: 21px;
}

.icon-copy svg * {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.link-qr {
  display: none;
  grid-column: 1 / -1;
  align-items: center;
  gap: 12px;
  padding: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.module-row.show-qr .link-qr {
  display: flex;
}

.link-qr img,
.qr-card img {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  padding: 6px;
  background: #fff;
  border-radius: var(--radius);
}

.action-grid,
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.skill-item {
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.skill-item div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.skill-item span {
  color: var(--muted);
}

.skill-item i {
  display: block;
  height: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
}

.skill-item i::before {
  display: block;
  width: var(--level);
  height: 100%;
  content: "";
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: inherit;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.project-card,
.qr-card {
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.project-card span {
  color: var(--accent);
  font-weight: 900;
}

.project-card h3 {
  margin-top: 12px;
}

.project-card p {
  margin: 10px 0 0;
  line-height: 1.65;
}

.qr-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.qr-card div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 4px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer strong {
  color: var(--soft);
}

.copied {
  color: #fff !important;
  background: var(--blue) !important;
  border-color: var(--blue) !important;
}

.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.toast {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(420px, calc(100% - 32px));
  padding: 13px 18px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.32);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast__icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: #06100d;
  background: var(--accent);
  border-radius: 50%;
  font-weight: 900;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
  }

  .profile-card {
    position: relative;
    top: auto;
    grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
    align-items: center;
  }

  .profile-status {
    grid-column: 1 / -1;
  }

  .action-grid,
  .tools-grid,
  .project-grid,
  .academic-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app {
    width: min(100% - 20px, 1200px);
    padding-top: 10px;
  }

  .profile-card {
    grid-template-columns: 1fr;
  }

  .profile-card__media {
    width: min(100%, 260px);
    justify-self: center;
  }

  .control-panel {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 20px;
  }

  .module-row {
    grid-template-columns: 1fr;
  }

  .module-actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .icon-copy,
  .qr-toggle {
    width: 100%;
  }

  .button,
  .control-btn {
    width: 100%;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
