.feather-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
}

.app-shell {
  width: min(1280px, 96vw);
  margin: 1.1rem auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
}

.sidebar,
.panel,
.content-card,
.hero-card,
.sidebar-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(8px);
}

.sidebar {
  position: sticky;
  top: 1rem;
  align-self: start;
  min-height: calc(100vh - 2.2rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
}

.sidebar-brand h1 {
  margin: 0.35rem 0;
}

.sidebar-copy {
  margin: 0;
  font-size: 0.93rem;
}

.nav {
  margin-top: 1.2rem;
  display: grid;
  gap: 0.5rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0.6rem 0.75rem;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-strong);
  border-color: rgba(209, 141, 255, 0.4);
  background: rgba(178, 87, 255, 0.15);
}

.sidebar-card {
  margin-top: 1.1rem;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-card strong {
  display: block;
  margin: 0.35rem 0;
  color: var(--purple-bright);
}

.sidebar-card p {
  margin: 0;
  font-size: 0.85rem;
}

.logout-btn {
  width: 100%;
  margin-top: 0.9rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-strong);
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.11);
}

.content {
  min-height: calc(100vh - 2.2rem);
}

.panel {
  display: none;
  padding: 1.1rem;
  box-shadow: var(--shadow-lg);
  animation: panel-in 280ms ease;
}

.panel.active {
  display: block;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#main {
  display: none;
}

#main.active {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.hero-copy h2 {
  margin: 0.5rem 0;
  font-size: clamp(1.35rem, 3vw, 2.2rem);
  line-height: 1.25;
}

.hero-copy h2 span {
  color: var(--purple-bright);
}

.hero-copy p {
  margin-top: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.social-link-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.social-link {
  text-decoration: none;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.84rem;
}

.social-link:hover {
  border-color: rgba(209, 141, 255, 0.42);
  background: rgba(178, 87, 255, 0.14);
}

.mini-stats {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.stat-card {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 0.6rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
}

.stat-card strong {
  display: block;
  color: var(--purple-bright);
  font-size: 1.2rem;
}

.stat-card span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.hero-stack {
  display: grid;
  gap: 0.85rem;
}

.hero-card,
.content-card {
  padding: 0.95rem;
}

.profile-card {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 0.8rem;
}

.profile-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-meta h3 {
  margin: 0.1rem 0;
}

.hero-meta p {
  margin: 0;
}

.reaction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.reaction-btn {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-strong);
}

.reaction-btn.is-selected,
.reaction-btn:hover {
  border-color: rgba(209, 141, 255, 0.46);
  background: rgba(178, 87, 255, 0.22);
}

.reaction-result {
  margin: 0.65rem 0;
  font-size: 0.88rem;
}

.reaction-board {
  display: grid;
  gap: 0.45rem;
}

.reaction-item {
  display: grid;
  grid-template-columns: 64px 1fr 40px;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.82rem;
}

.reaction-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.reaction-fill {
  height: 100%;
  background: linear-gradient(120deg, var(--purple-deep), var(--purple-bright));
}

.section-heading {
  margin-bottom: 0.9rem;
}

.section-heading h2,
.section-heading h3 {
  margin: 0.45rem 0 0;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.timeline-item + .timeline-item {
  margin-top: 0.7rem;
}

.timeline-item strong {
  display: block;
}

.timeline-item span {
  color: var(--silver);
  font-size: 0.82rem;
}

.skills-card {
  margin-top: 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
}

.skill-row + .skill-row {
  margin-top: 0.7rem;
}

.skill-copy {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
}

.skill-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.skill-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(120deg, var(--purple-deep), var(--purple-bright));
  transition: width 500ms ease;
}

.projects-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.tag {
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.2rem 0.56rem;
  font-size: 0.72rem;
  color: var(--silver);
}

.card-copy {
  margin-top: 0;
  font-size: 0.89rem;
}

.switch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.switch-btn {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-strong);
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

.switch-btn.active,
.switch-btn:hover {
  background: rgba(178, 87, 255, 0.22);
  border-color: rgba(209, 141, 255, 0.44);
}

.style-preview {
  margin-top: 0.6rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0.65rem;
  background: rgba(255, 255, 255, 0.03);
}

.style-label {
  margin: 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--silver);
}

.style-preview strong {
  display: block;
  margin-top: 0.2rem;
}

.style-preview span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.hover-reveal {
  margin-top: 0.75rem;
}

.hover-reveal > span {
  font-size: 0.72rem;
  color: var(--silver);
  text-transform: uppercase;
}

.preview-frame {
  margin-top: 0.35rem;
  border-radius: 11px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
}

.preview-frame img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 220ms ease;
}

.hover-reveal:hover img {
  transform: scale(1.06);
}

.preview-badge {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  font-size: 0.68rem;
  border-radius: 999px;
  padding: 0.18rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.45);
}

.palette-grid {
  display: flex;
  gap: 0.5rem;
}

.palette-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
}

.palette-swatch[data-color="royal"] {
  background: #8a3bd9;
}

.palette-swatch[data-color="frost"] {
  background: #c3c7d2;
}

.palette-swatch[data-color="shadow"] {
  background: #1d1b24;
}

.palette-swatch.active {
  border-color: #ffffff;
}

.palette-note {
  margin: 0.6rem 0 0;
  font-size: 0.82rem;
}

#gameCanvas {
  width: 100%;
  max-width: 400px;
  background: #090711;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 11px;
  margin-top: 0.55rem;
}

.score {
  margin: 0.5rem 0 0;
  color: var(--silver);
}

.play-zone-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.quiz-choices {
  display: grid;
  gap: 0.5rem;
}

.quiz-btn {
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text-strong);
  background: rgba(255, 255, 255, 0.03);
}

.quiz-btn.active,
.quiz-btn:hover {
  border-color: rgba(209, 141, 255, 0.44);
  background: rgba(178, 87, 255, 0.2);
}

.quiz-result {
  margin: 0.6rem 0 0;
  font-size: 0.86rem;
}

.guestbook-form {
  display: grid;
  gap: 0.6rem;
}

.field {
  display: grid;
  gap: 0.32rem;
}

.field label {
  font-size: 0.85rem;
  color: var(--silver);
}

.field input,
.field textarea {
  width: 100%;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-strong);
  padding: 0.62rem 0.72rem;
}

.guestbook-status {
  margin: 0.7rem 0;
  font-size: 0.82rem;
}

.guestbook-status.is-success {
  color: var(--success);
}

.guestbook-status.is-error {
  color: var(--danger);
}

.guestbook-list {
  display: grid;
  gap: 0.55rem;
  max-height: 220px;
  overflow: auto;
  padding-right: 0.2rem;
}

.guestbook-entry {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: rgba(255, 255, 255, 0.03);
}

.guestbook-entry strong {
  font-size: 0.88rem;
}

.guestbook-entry p {
  margin: 0.26rem 0 0;
  font-size: 0.84rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
  gap: 0.85rem;
}

.contact-form .form-response {
  margin: 0.65rem 0 0;
  color: var(--success);
  font-size: 0.87rem;
}

.contact-column {
  display: grid;
  gap: 0.85rem;
}

.contact-card p {
  margin: 0.35rem 0;
}

.social-link-stack {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

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

  .sidebar {
    position: static;
    min-height: 0;
  }

  #main.active {
    grid-template-columns: 1fr;
  }

  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .panel,
  .sidebar,
  .content-card,
  .hero-card {
    border-radius: 14px;
  }

  .mini-stats,
  .projects-grid,
  .about-grid,
  .play-zone-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

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

  .profile-img {
    max-width: 190px;
  }

  .hero-actions,
  .social-link-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-btn,
  .ghost-btn,
  .secondary-btn,
  .nav-link,
  .social-link {
    text-align: center;
  }
}