:root {
  --bg: #f5f7fb;
  --bg-elevated: #ffffff;
  --bg-sidebar: #0f172a;
  --bg-pill: #e0ecff;
  --text-main: #0f172a;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --border-subtle: #e5e7eb;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.08);
  --shadow-glow: 0 0 40px rgba(37, 99, 235, 0.15);
  --radius-lg: 18px;
  --radius-pill: 999px;
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

:root.dark {
  --bg: #020617;
  --bg-elevated: #020617;
  --bg-sidebar: #020617;
  --bg-pill: #0b1220;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --accent: #60a5fa;
  --accent-soft: #1d4ed8;
  --border-subtle: #1f2937;
  --shadow-soft: 0 20px 60px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 40px rgba(96, 165, 250, 0.2);
}

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

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at top left, #dbeafe, #f9fafb 40%, #eef2ff);
  color: var(--text-main);
  min-height: 100%;
  overflow-x: hidden;
  position: relative;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

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

@keyframes orbMove1 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(100px, -50px) scale(1.1);
  }
  66% {
    transform: translate(-50px, 100px) scale(0.9);
  }
}

@keyframes orbMove2 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(-100px, 100px) scale(0.9);
  }
  66% {
    transform: translate(50px, -50px) scale(1.1);
  }
}

@keyframes orbMove3 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(75px, 75px) scale(1.05);
  }
}

.particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.gradient-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

.gradient-orb--1 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  top: -250px;
  right: -250px;
  animation: orbMove1 20s ease-in-out infinite;
}

.gradient-orb--2 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  bottom: -200px;
  left: -200px;
  animation: orbMove2 25s ease-in-out infinite;
}

.gradient-orb--3 {
  width: 350px;
  height: 350px;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  top: 50%;
  left: 50%;
  animation: orbMove3 30s ease-in-out infinite;
}

body {
  line-height: 1.6;
}

/* Layout */

.page {
  max-width: 1240px;
  margin: 24px auto;
  margin-top: 70px;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 24px;
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.8s ease-out;
}

/* Sidebar */

.sidebar {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 24px 22px;
  color: #e5e7eb;
  box-shadow: var(--shadow-soft), var(--shadow-glow);
  position: sticky;
  top: 16px;
  align-self: flex-start;
  border: 1px solid rgba(148, 163, 184, 0.2);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.sidebar:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.15), var(--shadow-glow);
}

.sidebar__inner {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.avatar {
  display: flex;
  justify-content: center;
}

.avatar__image {
  width: 120px;
  height: 120px;
  border-radius: 999px;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.4), 0 0 0 8px rgba(79, 70, 229, 0.1);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
  animation: float 6s ease-in-out infinite;
}

.avatar__image:hover {
  transform: scale(1.05);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.5), 0 0 0 12px rgba(79, 70, 229, 0.2);
}

.name {
  margin: 20px 0 0;
  font-size: 24px;
  text-align: center;
  font-weight: 700;
  line-height: 1.3;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.role {
  margin: 8px 0;
  text-align: center;
  font-size: 14px;
  color: #e0e7ff;
  line-height: 1.5;
  font-weight: 400;
}

.role--small {
  font-size: 13px;
  color: #cbd5f5;
  margin-top: 4px;
}

.sidebar-heading {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin: 0 0 12px;
  color: #a5b4fc;
  font-weight: 600;
}

.contact__list,
.links__list,
.badge-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact__list li {
  font-size: 13px;
  margin-bottom: 8px;
  line-height: 1.6;
}

.contact__label {
  font-weight: 600;
  color: #a5b4fc;
  margin-right: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.contact a,
.links__list a {
  color: #ffffff;
  text-decoration: none;
  transition: all var(--transition-smooth);
  font-weight: 400;
}

.contact a:hover,
.links__list a:hover {
  color: #a5b4fc;
  transform: translateX(2px);
}

.links__list li {
  font-size: 13px;
  margin-bottom: 10px;
  line-height: 1.5;
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(165, 180, 252, 0.15);
  border: 1px solid rgba(165, 180, 252, 0.3);
  color: #e0e7ff;
  font-weight: 500;
  transition: all var(--transition-smooth);
}

.badge:hover {
  background: rgba(165, 180, 252, 0.25);
  border-color: rgba(165, 180, 252, 0.5);
  transform: translateY(-1px);
}

.sidebar-section {
  font-size: 13px;
}

.credits {
  font-size: 12px;
  margin: 0;
}

.copy-status {
  font-size: 11px;
  min-height: 16px;
  margin-top: 4px;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn--ghost {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: #e5e7eb;
}

.btn--ghost:hover {
  background: rgba(15, 23, 42, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.3);
}

.btn--outline {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.8);
  color: #e5e7eb;
  width: 100%;
  margin-top: 4px;
}

.btn--outline:hover {
  background: rgba(17, 24, 39, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.3);
}

/* Top nav */

.content {
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow-soft), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  border: 1px solid rgba(148, 163, 184, 0.2);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
  position: relative;
}

.content:hover {
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

:root.dark .content {
  background: rgba(15, 23, 42, 0.92);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
}

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  padding: 0;
  margin: 0;
  background: transparent;
}

.top-nav__wrapper {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  padding: 10px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  transition: all var(--transition-smooth);
}

.top-nav.scrolled .top-nav__wrapper {
  background: linear-gradient(135deg, rgba(30, 41, 59, 1) 0%, rgba(15, 23, 42, 1) 100%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

:root.dark .top-nav__wrapper {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(7, 11, 21, 0.98) 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

:root.dark .top-nav.scrolled .top-nav__wrapper {
  background: linear-gradient(135deg, rgba(15, 23, 42, 1) 0%, rgba(7, 11, 21, 1) 100%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.top-nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 1240px;
  margin: 0 auto;
}

.top-nav__link {
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  color: rgba(226, 232, 240, 0.9);
  cursor: pointer;
  transition: all var(--transition-smooth);
  position: relative;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.top-nav__link:hover {
  background: rgba(71, 85, 105, 0.4);
  color: #ffffff;
  border-color: rgba(148, 163, 184, 0.3);
}

.top-nav__link.is-active {
  background: rgba(71, 85, 105, 0.8);
  color: #ffffff;
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

:root.dark .top-nav__link.is-active {
  background: rgba(51, 65, 85, 0.9);
  color: #e2e8f0;
}


/* Sections */

.section {
  display: none;
  padding: 20px 24px 24px;
  animation: fadeInUp 0.6s ease-out;
  scroll-margin-top: 80px;
}

.section--active {
  display: block;
}

.section__title {
  margin: 8px 0 4px;
  font-size: 20px;
}

.section__subtitle {
  font-size: 15px;
  margin: 8px 0 6px;
}

.section__lead {
  margin-top: 2px;
  margin-bottom: 10px;
  color: var(--text-muted);
}

/* Cards */

.card {
  margin-top: 10px;
  padding: 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.06);
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-smooth);
}

.card:hover::before {
  transform: scaleX(1);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
  border-color: rgba(37, 99, 235, 0.3);
}

.card__header {
  margin-bottom: 6px;
}

.card__title {
  font-size: 15px;
  margin: 0 0 2px;
}

.card__meta {
  font-size: 12px;
  margin: 0;
  color: var(--text-muted);
}

.card__meta--time {
  font-style: italic;
}

.card__list {
  margin: 6px 0 4px;
  padding-left: 18px;
  font-size: 13px;
}

.card__list li {
  margin-bottom: 3px;
}

.card__list ul {
  margin-top: 8px;
  padding-left: 20px;
}

.card__note {
  font-size: 12px;
  margin-top: 4px;
  color: var(--text-muted);
}

.card--research {
  margin-top: 14px;
}

/* Simple lists */

.simple-list {
  list-style: none;
  margin: 4px 0 0;
  padding-left: 0;
  font-size: 13px;
}

.simple-list li {
  margin-bottom: 3px;
}

/* Grid & columns */

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 8px;
}

/* Pills */

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 6px;
}

.pill {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  background: var(--bg-pill);
  color: #1f2937;
  transition: all var(--transition-smooth);
  cursor: default;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.pill:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.2);
  background: linear-gradient(135deg, #dbeafe 0%, #e0ecff 100%);
}

:root.dark .pill {
  color: #e5e7eb;
}

/* Apps grid */

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.app-card {
  border-radius: 20px;
  padding: 20px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

.app-card:hover::before {
  opacity: 0.05;
}

.app-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
  border-color: rgba(37, 99, 235, 0.4);
}

.app-card > * {
  position: relative;
  z-index: 1;
}

.app-card__title {
  margin: 0 0 2px;
  font-size: 14px;
}

.app-card__meta {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.app-card__text {
  margin: 0 0 8px;
  font-size: 13px;
}

.app-card__link {
  margin-top: auto;
  align-self: flex-start;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.app-card__link:hover {
  background: var(--accent);
  color: #ffffff;
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Footer */

.footer {
  border-top: 1px dashed var(--border-subtle);
  margin: 10px 24px 0;
  padding: 12px 0 20px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
}

/* Responsive */

@media (max-width: 960px) {
  .page {
    grid-template-columns: 1fr;
    margin-top: 70px;
  }

  .sidebar {
    position: static;
    order: -1;
  }

  .top-nav__wrapper {
    padding: 8px 16px;
  }

  .top-nav__links {
    gap: 6px;
  }

  .top-nav__link {
    padding: 6px 12px;
    font-size: 12px;
  }
}

@media (max-width: 640px) {
  .page {
    margin: 8px;
    margin-top: 60px;
    padding: 8px;
  }

  .content {
    border-radius: 16px;
  }

  .two-column {
    grid-template-columns: 1fr;
  }

  .top-nav__wrapper {
    padding: 8px 12px;
  }

  .top-nav__links {
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
  }

  .top-nav__links::-webkit-scrollbar {
    display: none;
  }

  .top-nav__link {
    padding: 6px 10px;
    font-size: 11px;
    flex-shrink: 0;
  }

  .section {
    padding: 16px 16px 20px;
    scroll-margin-top: 70px;
  }

  .content {
    scroll-margin-top: 70px;
  }

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

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
  .top-nav {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }

  .top-nav__wrapper {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
}
