:root {
  --bg: #08060f;
  --surface: rgba(18, 14, 31, 0.9);
  --surface-2: rgba(28, 20, 45, 0.92);
  --line: rgba(216, 180, 254, 0.26);
  --text: #f4e9ff;
  --text-dim: #ccb7ea;
  --purple: #a855f7;
  --purple-soft: #d8b4fe;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.52);
  --glow: 0 0 28px rgba(168, 85, 247, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background: var(--bg);
}

body {
  display: grid;
  place-items: center;
  overflow-x: hidden;
}

.work-bg {
  position: fixed;
  inset: 0;
  background: linear-gradient(145deg, #06030f, #0e0a1d 50%, #120b26);
}

.bg-nebula,
.bg-stars,
.bg-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.bg-nebula {
  background: radial-gradient(circle at 20% 20%, rgba(168, 85, 247, 0.22), transparent 38%),
    radial-gradient(circle at 82% 75%, rgba(91, 33, 182, 0.24), transparent 42%);
}

.bg-stars {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.42) 0.5px, transparent 1px);
  background-size: 3px 3px;
  opacity: 0.12;
}

.bg-glow {
  background: radial-gradient(circle at 50% 0, rgba(168, 85, 247, 0.09), transparent 55%);
}

.work-shell {
  position: relative;
  z-index: 2;
  width: min(1100px, 92vw);
  min-height: min(780px, 92vh);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  box-shadow: var(--shadow), var(--glow);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.work-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 10, 25, 0.9);
}

.window-dots {
  display: flex;
  gap: 0.35rem;
}

.window-dots span {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(216, 180, 254, 0.6);
}

.work-title {
  display: grid;
  justify-items: center;
  flex: 1;
  min-width: 0;
}

.work-title strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

.work-title span {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.garden-link {
  color: var(--text);
  text-decoration: none;
  font-size: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.4rem 0.7rem;
  background: rgba(27, 18, 44, 0.8);
}

.garden-link:hover,
.garden-link:focus-visible {
  border-color: rgba(216, 180, 254, 0.52);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.26);
  outline: none;
}

.work-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 0;
}

.work-nav {
  border-right: 1px solid var(--line);
  padding: 1rem 0.75rem;
  display: grid;
  align-content: start;
  gap: 0.55rem;
  background: rgba(13, 9, 22, 0.7);
}

.nav-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  cursor: pointer;
}

.nav-btn:hover,
.nav-btn:focus-visible,
.nav-btn.active {
  border-color: rgba(216, 180, 254, 0.5);
  background: rgba(168, 85, 247, 0.15);
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.14);
  outline: none;
}

.nav-note {
  margin-top: 0.45rem;
  font-size: 0.77rem;
  color: var(--text-dim);
  opacity: 0.9;
}

.work-main {
  min-height: 0;
  padding: 1.1rem;
  overflow: auto;
}

.panel {
  display: none;
  animation: panelFade 220ms ease;
}

.panel.active {
  display: block;
}

.panel-home {
  max-width: 680px;
}

.eyebrow {
  margin: 0;
  color: var(--purple-soft);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0.35rem 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 4vw, 2.9rem);
}

h2 {
  margin: 0.2rem 0 0.7rem;
  font-size: 1.1rem;
  color: var(--text-dim);
}

.panel-home p {
  color: var(--text-dim);
  line-height: 1.55;
}

.cta-btn,
.back-btn {
  border: 1px solid rgba(216, 180, 254, 0.5);
  border-radius: 10px;
  padding: 0.55rem 0.85rem;
  background: rgba(30, 20, 50, 0.9);
  color: var(--text);
  cursor: pointer;
}

.cta-btn:hover,
.cta-btn:focus-visible,
.back-btn:hover,
.back-btn:focus-visible {
  background: rgba(168, 85, 247, 0.25);
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.2);
  outline: none;
}

.tiny-moth {
  margin-top: 0.9rem;
  font-size: 0.77rem;
  color: #b79bd8;
}

.panel-head h3 {
  margin: 0;
  font-size: 1.3rem;
}

.panel-head p {
  margin: 0.45rem 0 1rem;
  color: var(--text-dim);
}

.project-sections {
  display: grid;
  gap: 0.75rem;
}

.project-category {
  border: 1px solid rgba(216, 180, 254, 0.25);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(14, 10, 24, 0.7);
}

.category-toggle {
  width: 100%;
  border: 0;
  background: rgba(26, 18, 42, 0.86);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid rgba(216, 180, 254, 0.15);
  cursor: pointer;
  text-align: left;
}

.category-toggle span {
  font-weight: 600;
}

.category-toggle small {
  color: var(--text-dim);
  font-size: 0.78rem;
}

.category-toggle::after {
  content: '▾';
  color: var(--purple-soft);
  transition: transform 180ms ease;
}

.project-category.open .category-toggle::after {
  transform: rotate(180deg);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  padding: 0.8rem;
}

.project-category:not(.open) .project-grid {
  display: none;
}

.project-card {
  border: 1px solid rgba(216, 180, 254, 0.24);
  border-radius: 12px;
  background: rgba(16, 11, 28, 0.72);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}

.project-card:hover,
.project-card:focus-visible {
  border-color: rgba(216, 180, 254, 0.52);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.2);
  outline: none;
}

.project-thumb {
  height: 120px;
  background: linear-gradient(150deg, rgba(91, 33, 182, 0.35), rgba(19, 12, 33, 0.9));
  border-bottom: 1px solid rgba(216, 180, 254, 0.2);
  overflow: hidden;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-meta {
  padding: 0.75rem;
}

.project-meta h4 {
  margin: 0;
}

.project-meta p {
  margin: 0.45rem 0 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}

#project-detail-content h3 {
  margin: 0.85rem 0 0.35rem;
}

#project-detail-content p,
#project-detail-content li {
  color: var(--text-dim);
  line-height: 1.55;
}

.detail-link {
  color: var(--text);
  text-decoration: none;
  border: 1px solid rgba(216, 180, 254, 0.4);
  background: rgba(30, 20, 50, 0.85);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  display: inline-block;
}

.detail-link:hover,
.detail-link:focus-visible {
  background: rgba(168, 85, 247, 0.25);
  outline: none;
}

.resume-list {
  margin: 0;
  padding-left: 1rem;
  color: var(--text-dim);
  line-height: 1.55;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(170px, 210px) 1fr;
  gap: 1rem;
  align-items: start;
}

.about-photo-card {
  margin: 0;
  border: 1px solid rgba(216, 180, 254, 0.28);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(15, 10, 25, 0.8);
}

.about-photo-card img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.about-copy p {
  margin: 0 0 0.8rem;
  color: var(--text-dim);
  line-height: 1.55;
}

.about-block {
  margin-top: 0.9rem;
  border: 1px solid rgba(216, 180, 254, 0.2);
  border-radius: 12px;
  padding: 0.8rem;
  background: rgba(14, 10, 24, 0.46);
}

.about-block h4 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.about-block p,
.about-tools li {
  color: var(--text-dim);
  line-height: 1.5;
}

.about-tools {
  margin: 0;
  padding-left: 1rem;
}

.contact-form {
  display: grid;
  gap: 0.75rem;
  max-width: 640px;
}

.contact-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.contact-form input,
.contact-form textarea {
  border: 1px solid rgba(216, 180, 254, 0.35);
  border-radius: 10px;
  background: rgba(11, 8, 20, 0.82);
  color: var(--text);
  padding: 0.65rem 0.7rem;
  font: inherit;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #a58abb;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: rgba(216, 180, 254, 0.62);
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.22);
  outline: none;
}

.contact-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.contact-actions button,
.contact-actions a {
  text-decoration: none;
  color: var(--text);
  border: 1px solid rgba(216, 180, 254, 0.4);
  border-radius: 10px;
  padding: 0.48rem 0.72rem;
  background: rgba(30, 20, 50, 0.85);
  font: inherit;
  cursor: pointer;
}

.contact-actions button:hover,
.contact-actions button:focus-visible,
.contact-actions a:hover,
.contact-actions a:focus-visible {
  background: rgba(168, 85, 247, 0.25);
  outline: none;
}

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

@media (max-width: 900px) {
  body {
    display: block;
  }

  .work-shell {
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .work-body {
    grid-template-columns: 1fr;
  }

  .work-nav {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
  }

  .nav-btn {
    text-align: center;
    font-size: 0.85rem;
  }

  .nav-note {
    grid-column: 1 / -1;
    text-align: center;
  }

  .about-layout {
    grid-template-columns: 1fr;
  }
}
