:root {
  --bg-void: #0a0a0a;
  --bg-deep: #111111;
  --bg-surface: #161616;
  --bg-elevated: #1c1c1c;
  --bg-card: #111111;

  --text-primary: #e8e8e8;
  --text-secondary: #888888;
  --text-muted: #555555;

  --accent: #c0c0c0;
  --accent-dim: #888888;
  --accent-subtle: rgba(200, 200, 200, 0.06);

  --lavender: #c0c0c0;
  --lavender-dim: #888888;
  --lavender-glow: rgba(200, 200, 200, 0.06);
  --lavender-subtle: rgba(200, 200, 200, 0.03);

  --pink: #c0c0c0;
  --pink-glow: rgba(200, 200, 200, 0.06);
  --pink-subtle: rgba(200, 200, 200, 0.03);

  --gold: #c0c0c0;
  --gold-dim: #888888;
  --gold-glow: rgba(200, 200, 200, 0.06);

  --mint: #c0c0c0;
  --mint-subtle: rgba(200, 200, 200, 0.03);

  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Cormorant Garamond', 'Georgia', serif;
  --font-mono: 'Courier New', monospace;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;

  --max-width: 900px;
  --nav-height: 60px;

  --nav-bg: rgba(10, 10, 10, 0.95);
  --nav-border: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.08);
  --lightbox-bg: rgba(10, 10, 10, 0.95);
}

[data-theme="day"] {
  --bg-void: #f4f2ef;
  --bg-deep: #eae7e3;
  --bg-surface: #e2dfdb;
  --bg-elevated: #d9d6d2;
  --bg-card: #eae7e3;

  --text-primary: #1a1a1a;
  --text-secondary: #555555;
  --text-muted: #888888;

  --accent: #444444;
  --accent-dim: #666666;
  --accent-subtle: rgba(0, 0, 0, 0.04);

  --lavender: #444444;
  --lavender-dim: #666666;
  --lavender-glow: rgba(0, 0, 0, 0.04);
  --lavender-subtle: rgba(0, 0, 0, 0.02);

  --pink: #444444;
  --pink-glow: rgba(0, 0, 0, 0.04);
  --pink-subtle: rgba(0, 0, 0, 0.02);

  --gold: #444444;
  --gold-dim: #666666;
  --gold-glow: rgba(0, 0, 0, 0.04);

  --mint: #444444;
  --mint-subtle: rgba(0, 0, 0, 0.02);

  --nav-bg: rgba(244, 242, 239, 0.95);
  --nav-border: rgba(0, 0, 0, 0.08);
  --card-border: rgba(0, 0, 0, 0.08);
  --lightbox-bg: rgba(244, 242, 239, 0.95);
}

.scanlines {
  display: none;
}

/* Theme toggle */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10001;
  background: transparent;
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.theme-toggle:hover {
  color: var(--lavender);
}

.theme-toggle .icon-moon,
[data-theme="day"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="day"] .theme-toggle .icon-moon {
  display: inline;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background: var(--bg-void);
  color: var(--text-primary);
  line-height: 1.8;
  overflow-x: hidden;
  font-size: 17px;
  cursor: default;
  transition: background-color 0.6s ease, color 0.6s ease;
}

::selection {
  background: var(--text-secondary);
  color: var(--bg-void);
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.015) 3px,
    rgba(0, 0, 0, 0.015) 6px
  );
}

.scanlines::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(196, 168, 255, 0.012) 50%,
    transparent 100%
  );
  height: 150px;
  animation: scanline-drift 12s linear infinite;
}

@keyframes scanline-drift {
  0% { transform: translateY(-150px); }
  100% { transform: translateY(100vh); }
}

#particles {
  display: none;
}

#sparkles {
  display: none;
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  transform: translateY(-100%);
  transition: transform 0.4s ease;
}

.nav.visible {
  transform: translateY(0);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-md);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-logo:hover {
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  gap: 1.2rem;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
  padding: 0.25em 0;
  transition: color 0.3s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text-secondary);
  transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: var(--space-lg) var(--space-md) var(--space-md);
}

.hero-grid {
  display: none;
}

.hero-content {
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-badge {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-style: italic;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  opacity: 0;
  animation: fade-in 0.8s 0.5s forwards;
}


.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--text-primary);
  position: relative;
  display: inline-block;
  opacity: 0;
  animation: fade-in 0.6s 0.8s forwards;
}

.hero-name .glitch-layer {
  display: none;
}

.hero-tagline {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: var(--space-md);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.6em;
  opacity: 0;
  animation: fade-in 0.6s 1.2s forwards;
}

.tag-sep {
  color: var(--gold);
  font-size: 0.7em;
}

.cat-face {
  display: inline-block;
  color: var(--pink);
}

.hero-scroll {
  position: absolute;
  bottom: -6rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  opacity: 0;
  animation: hero-scroll-in 0.6s 1.8s forwards;
}

@keyframes hero-scroll-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.scroll-text {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(180deg, var(--lavender-dim), transparent);
  opacity: 0.5;
}

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
  position: relative;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-header {
  margin-bottom: var(--space-lg);
}

.section-glyph {
  font-size: 0.9rem;
  color: var(--lavender-dim);
  flex-shrink: 0;
  transition: color 0.3s;
}

.section:hover .section-glyph {
  color: var(--lavender);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  flex-shrink: 0;
}

.section-line {
  display: none;
}

.section-content p {
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  max-width: 640px;
}

.section-content p strong {
  color: var(--text-primary);
  font-weight: 600;
}

.section-intro {
  text-align: left;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: calc(-1 * var(--space-md));
  margin-bottom: var(--space-md);
  max-width: none;
}


.subsection-title {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--lavender);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(179, 157, 219, 0.2);
}

.subsection-title:first-child {
  margin-top: 0;
}

#projects, #skills {
  max-width: 1300px;
}

/* Compact quest card grid */
.quest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: var(--space-sm);
}

@media (max-width: 1000px) {
  .quest-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .quest-card-wide {
    grid-column: span 1;
  }
  .quest-card-portrait {
    flex-direction: column;
  }
  .quest-card-portrait-media {
    width: 100%;
    height: 150px;
    min-height: auto;
  }
}

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

/* PUBLIC PROJECTS SECTION */
.public-projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.public-project-card-link,
.public-project-card-link:visited,
.public-project-card-link:hover,
.public-project-card-link:active {
  display: block;
  text-decoration: none;
  color: inherit;
}

.public-project-card {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 0;
  overflow: hidden;
  transition: border-color 0.3s;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.public-project-card-link:hover .public-project-card {
  border-color: var(--text-muted);
}

.public-project-visual {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: var(--bg-surface);
}

.public-project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.9) brightness(0.95);
  transition: filter 0.35s;
}

.public-project-card-link:hover .public-project-image {
  filter: saturate(1) brightness(1);
}

.public-project-content {
  padding: var(--space-md);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.public-project-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  font-style: italic;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.public-project-description {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
  flex: 1;
}

.public-project-links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.public-project-link,
.public-project-link-github {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: transform 0.25s, opacity 0.25s;
  display: inline-block;
  cursor: pointer;
}

.public-project-card-link:hover .public-project-link,
.public-project-card-link:hover .public-project-link-github {
  transform: translateX(2px);
  opacity: 0.8;
}

@media (max-width: 768px) {
  .public-projects-grid {
    grid-template-columns: 1fr;
  }
}

.quest-card-link,
.quest-card-link:visited,
.quest-card-link:hover,
.quest-card-link:active {
  display: block;
  text-decoration: none;
  color: inherit;
}

.quest-card-link .quest-card {
  height: 100%;
}

.quest-card {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 0;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s;
  display: flex;
  flex-direction: column;
}

.quest-card:hover {
  border-color: var(--text-muted);
}

/* Card type borders — uniform monochrome */
.quest-card-event,
.quest-card-hardware,
.quest-card-software {
  border-left: none;
}

.quest-card-body {
  padding: var(--space-sm);
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Media — landscape on top */
.quest-card-media {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  filter: saturate(0.85) brightness(0.95);
  transition: filter 0.35s;
}

.quest-card:hover .quest-card-media {
  filter: saturate(1) brightness(1);
}

.quest-card-media-contain {
  object-fit: contain;
  background: var(--bg-surface);
}

.quest-card-media-portrait {
  object-position: top center;
}

/* Portrait layout — video on side */
.quest-card-portrait {
  flex-direction: row;
}

.quest-card-portrait-media {
  width: 140px;
  align-self: stretch;
  object-fit: cover;
  flex-shrink: 0;
  filter: saturate(0.85) brightness(0.95);
  transition: filter 0.35s;
}

.quest-card:hover .quest-card-portrait-media {
  filter: saturate(1) brightness(1);
}


/* Gradient placeholder for cards without images */
.quest-card-placeholder {
  height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.placeholder-hosted,
.placeholder-attending,
.placeholder-deployed {
  background: var(--bg-surface);
}

.placeholder-icon {
  font-size: 2rem;
  opacity: 0.6;
}

.placeholder-label {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Card text */
.quest-card-status {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.quest-card-status.status-active {
  color: var(--mint);
}

.quest-card-status.status-hosted {
  color: var(--gold);
}

.quest-card-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  font-style: italic;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  line-height: 1.35;
}

.quest-card-desc {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.6rem;
  max-width: none;
  flex: 1;
}

.quest-card-desc a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.3);
  text-underline-offset: 2px;
}

.quest-card-desc a:hover {
  text-decoration-color: var(--lavender);
}

.quest-card .project-tags {
  gap: 0.3rem;
}

.quest-card .project-tag {
  font-size: 0.55rem;
  padding: 0.15rem 0.4rem;
}

/* Skill pills — subtle tech stack display */
.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.5rem;
}

.skill-pill {
  font-family: var(--font-body);
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: rgba(196, 168, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 2px;
  padding: 0.1rem 0.35rem;
  text-transform: uppercase;
}

.quest-card .quest-hint {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--lavender-dim);
  opacity: 0;
  text-align: right;
  margin-top: 0.4rem;
  transition: opacity 0.3s, letter-spacing 0.3s;
}

.quest-card:hover .quest-hint {
  opacity: 1;
  letter-spacing: 0.15em;
}

/* Filtered-out for quest cards */
.quest-card-link.filtered-out,
.quest-card.filtered-out {
  opacity: 0.1;
  transform: scale(0.97);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.quest-card-link:not(.filtered-out),
.quest-card:not(.filtered-out) {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Two-column layout */
.two-col-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: start;
}

@media (max-width: 900px) {
  .two-col-layout {
    grid-template-columns: 1fr;
  }
}

.col-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.col-heading {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--lavender);
  letter-spacing: 0.08em;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(196, 168, 255, 0.12);
}

.project-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Filter bar */
.card-key {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: 0.75rem;
}

.card-key-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.card-key-swatch {
  display: inline-block;
  width: 12px;
  height: 3px;
  border-radius: 1px;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.filter-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.filter-tag {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.65rem;
  border-radius: 2px;
  border: 1px solid rgba(196, 168, 255, 0.12);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
}

.filter-tag:hover {
  border-color: rgba(196, 168, 255, 0.3);
  color: var(--text-primary);
}

.filter-tag.active {
  background: rgba(196, 168, 255, 0.12);
  border-color: var(--lavender);
  color: var(--lavender);
}

/* Filterable tags on cards */
.filterable-tag {
  cursor: pointer;
  transition: all 0.25s ease;
}

.filterable-tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(196, 168, 255, 0.15);
}

/* Filtered-out state */
.project-card-link.filtered-out,
.tidbit.filtered-out {
  opacity: 0.1;
  transform: scale(0.97);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.project-card-link:not(.filtered-out),
.tidbit:not(.filtered-out) {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.section.revealed {
  opacity: 1;
  transform: translateY(0);
}

.about-layout {
  display: flex;
  flex-direction: column;
}

.about-portrait {
  position: relative;
  margin-bottom: var(--space-md);
  width: fit-content;
  cursor: pointer;
}

.portrait-frame {
  width: 200px;
  height: 200px;
  border: 1px solid var(--card-border);
  border-radius: 0;
  overflow: hidden;
  position: relative;
  background: var(--bg-surface);
  transition: border-color 0.3s;
}

.portrait-frame:hover {
  border-color: var(--text-muted);
}

.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.4s;
}

.portrait-frame:hover .portrait-img {
  filter: saturate(1) contrast(1);
}

.portrait-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 0.4rem;
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-elevated));
}

.portrait-kaomoji {
  font-size: 1.8rem;
  color: var(--pink);
  animation: cat-blink 4s infinite;
}

.portrait-hint {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.boop-effect {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 0.3rem;
  pointer-events: none;
  opacity: 0;
  z-index: 10;
  white-space: nowrap;
}

.boop-effect.active {
  display: flex;
  animation: boop-float 2.5s ease-out forwards;
}

.boop-text {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--pink);
  letter-spacing: 0.05em;
  text-shadow: 0 0 8px rgba(255, 142, 196, 0.5);
}

.boop-heart {
  font-size: 0.8rem;
  color: var(--pink);
  text-shadow: 0 0 8px rgba(255, 142, 196, 0.5);
  animation: none;
}

.boop-effect.active .boop-heart {
  animation: boop-heart-pop 0.6s 0.1s ease-out both;
}

@keyframes boop-float {
  0% { opacity: 0; transform: translateX(-50%) translateY(0) scale(0.5); }
  10% { opacity: 1; transform: translateX(-50%) translateY(-10px) scale(1.1); }
  20% { opacity: 1; transform: translateX(-50%) translateY(-18px) scale(1); }
  75% { opacity: 1; transform: translateX(-50%) translateY(-22px) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-40px) scale(0.8); }
}

@keyframes boop-heart-pop {
  0% { transform: scale(0); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

.portrait-sparkle {
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: 1rem;
  animation: twinkle-icon 2.5s ease-in-out infinite;
  pointer-events: none;
}

.about-stats {
  display: flex;
  gap: var(--space-lg);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(196, 168, 255, 0.08);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  flex: 1;
}

.stat-icon {
  font-size: 1rem;
  line-height: 1;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  font-style: italic;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.skill-tree {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

/* Skills & Achievements two-column layout */
.skills-achievements-layout {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: var(--space-md);
  align-items: start;
}

.column-heading {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

@media (max-width: 900px) {
  .skills-achievements-layout {
    grid-template-columns: 1fr;
  }
}

.skill-tree-compact {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding: var(--space-md);
  border: 1px solid var(--card-border);
  background: var(--bg-card);
  border-radius: 2px;
}

.skill-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.skill-group-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--lavender-dim);
  text-transform: uppercase;
  margin-right: 0.4rem;
  white-space: nowrap;
}

.skill-branch {
  padding: var(--space-md);
  border: 1px solid var(--card-border);
  background: var(--bg-card);
  border-radius: 2px;
  position: relative;
  transition: border-color 0.4s;
}

.skill-branch:hover {
  border-color: rgba(196, 168, 255, 0.15);
}

.skill-branch::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--text-muted);
  opacity: 0.2;
  transition: opacity 0.4s;
}

.skill-branch:hover::before {
  opacity: 0.4;
}

.skill-branch-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--lavender-dim);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
}

.skill-nodes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skill-node {
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  padding: 0.35em 0.7em;
  border-radius: 2px;
  border: 1px solid;
  transition: transform 0.2s, box-shadow 0.2s;
}

.skill-node:hover {
  transform: translateY(-1px);
}

.skill-node.max {
  color: var(--text-primary);
  border-color: var(--card-border);
  background: transparent;
}

.skill-node.high {
  color: var(--text-secondary);
  border-color: var(--card-border);
  background: transparent;
}

.skill-node.mid {
  color: var(--text-muted);
  border-color: var(--card-border);
  background: transparent;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

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

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 0;
  padding: var(--space-md);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 100%;
  background: var(--text-secondary);
  opacity: 0;
  transition: opacity 0.4s;
}

.project-card::after {
  display: none;
}

.project-card:hover {
  border-color: var(--text-muted);
}

.project-card:hover::before {
  opacity: 0.2;
}

.project-card:hover::after {
  display: none;
}

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

.project-video-layout {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.project-video-side {
  flex-shrink: 0;
  width: 160px;
  height: 240px;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid rgba(196, 168, 255, 0.1);
}

.project-video-portrait,
.project-img-side {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.85) brightness(0.9);
  transition: filter 0.5s;
}

.project-img-side {
  object-fit: contain;
  background: var(--bg-surface);
}

.project-card-video:hover .project-video-portrait,
.project-card-video:hover .project-img-side {
  filter: saturate(1) brightness(1);
}

.project-video-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-video-content .project-xp {
  margin-top: auto;
}

@media (max-width: 640px) {
  .project-video-layout {
    flex-direction: column;
  }

  .project-video-side {
    width: 100%;
    height: 160px;
  }
}

.project-img-wrap {
  margin: calc(-1 * var(--space-md));
  margin-bottom: var(--space-md);
  overflow: hidden;
  border-bottom: 1px solid var(--card-border);
  position: relative;
}

.project-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  filter: saturate(0.8) brightness(0.85);
  transition: filter 0.5s, transform 0.5s;
  cursor: pointer;
}

.project-card:hover .project-img {
  filter: saturate(1) brightness(1);
  transform: scale(1.03);
}

.project-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 120px;
  background: var(--bg-elevated);
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.project-img-contain {
  object-fit: contain;
  background: var(--bg-surface);
  height: auto;
  max-height: 220px;
  padding: 0.5rem;
}

.project-caption {
  margin-top: -0.8rem;
  margin-bottom: 0.8rem;
}

.project-status {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--mint);
  margin-bottom: var(--space-sm);
}

.project-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.project-date {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: inherit;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.project-tags {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
  flex-wrap: wrap;
}

.project-tag {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--lavender-dim);
  padding: 0.3em 0.8em;
  border: 1px solid rgba(196, 168, 255, 0.12);
  background: rgba(196, 168, 255, 0.04);
  border-radius: 2px;
}

.project-tag.tag-platform {
  color: var(--mint);
  border-color: rgba(126, 255, 200, 0.15);
  background: rgba(126, 255, 200, 0.04);
}

.project-tag.tag-hardware {
  color: var(--pink);
  border-color: rgba(255, 142, 196, 0.15);
  background: rgba(255, 142, 196, 0.04);
}

.project-tag.tag-ai {
  color: var(--lavender);
  border-color: rgba(196, 168, 255, 0.15);
  background: rgba(196, 168, 255, 0.04);
}

.project-tag.tag-software {
  color: var(--accent);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.project-xp {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: var(--space-sm);
  text-align: right;
}

.status-active {
  color: var(--text-secondary);
}

.status-locked {
  color: var(--text-muted);
}

.quest-locked {
  opacity: 0.6;
}

.quest-locked:hover {
  opacity: 0.8;
}

.quest-active::before {
  opacity: 0.6;
  background: linear-gradient(180deg, var(--gold), var(--gold-dim));
}

.project-card-link,
.project-card-link:visited,
.project-card-link:hover,
.project-card-link:active {
  display: block;
  text-decoration: none;
  color: inherit;
}

.quest-hint {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--lavender);
  opacity: 0.6;
  transition: opacity 0.3s, letter-spacing 0.3s;
  text-align: right;
  margin-top: var(--space-sm);
  position: relative;
  z-index: 1;
}

.project-card:hover .quest-hint {
  opacity: 1;
  letter-spacing: 0.15em;
}

/* Completed quests collapsible */
.completed-quests {
  margin-top: var(--space-md);
}

.completed-quests-toggle {
  display: flex;
  align-items: center;
  gap: 0.5em;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--lavender);
  opacity: 0.55;
  user-select: none;
  transition: opacity 0.2s;
  width: fit-content;
}

.completed-quests-toggle::-webkit-details-marker {
  display: none;
}

.completed-quests:hover > .completed-quests-toggle {
  opacity: 0.85;
}

.completed-quests-icon {
  font-size: 0.7em;
}

.completed-quests-chevron {
  margin-left: 0.2em;
  transition: transform 0.25s;
  display: inline-block;
}

.completed-quests[open] .completed-quests-chevron {
  transform: rotate(180deg);
}

.completed-quests-grid {
  margin-top: var(--space-sm);
  opacity: 0.75;
}

.writing-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}

.writing-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-family: var(--font-body);
  color: var(--text-secondary);
  text-decoration: none;
  padding: var(--space-md);
  border: 1px solid var(--card-border);
  background: var(--bg-card);
  transition: border-color 0.3s;
  border-radius: 0;
}

.writing-card:hover {
  border-color: var(--text-muted);
}

.writing-card-icon {
  font-size: 1.6rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.writing-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.writing-card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text-primary);
  letter-spacing: 0.03em;
}

.writing-card-sub {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.writing-card-locked {
  cursor: default;
}

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

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: var(--space-sm);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  padding: 0.5rem 0;
  color: inherit;
  border: none;
  background: none;
  transition: color 0.2s;
}

.contact-card:hover {
  color: var(--text-primary);
}

.contact-card-icon {
  width: 24px;
  height: 24px;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: color 0.2s;
}

.contact-card:hover .contact-card-icon {
  color: var(--text-primary);
}

.contact-card-icon svg {
  width: 100%;
  height: 100%;
}

.contact-card-label {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 400;
  color: inherit;
}

.contact-card-handle {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-left: auto;
}

.contact-card-ping {
  display: none;
}

.achievements-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: var(--space-sm);
}

.achievements-grid .tidbit:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

.achievements-grid .tidbit:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}

.achievements-grid .tidbit:nth-child(3) {
  grid-column: 2;
  grid-row: 1 / 3;
}

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

.tidbits-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.tidbits-grid-2col {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: var(--space-sm);
}

@media (max-width: 768px) {
  .tidbits-grid-2col {
    grid-template-columns: 1fr;
  }
}

.tidbit-awards {
  border-color: var(--card-border);
}

.tidbit-awards:hover {
  border-color: var(--text-muted);
}

.award-highlight {
  color: var(--text-primary);
}

.tidbit {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md);
  border: 1px solid var(--card-border);
  background: var(--bg-card);
  border-radius: 0;
  transition: border-color 0.3s;
}

.tidbit:hover {
  border-color: var(--text-muted);
}

.tidbit-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  line-height: 1.7;
}

.tidbit-body {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.tidbit-text {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.tidbit-text a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.3);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.3s;
}

.tidbit-text a:hover {
  text-decoration-color: var(--gold);
}

.tidbit-link {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--text-muted);
  transition: border-color 0.3s;
}

.tidbit-link:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.tidbit-media {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tidbit-img {
  width: 100px;
  height: 75px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid rgba(196, 168, 255, 0.1);
  filter: saturate(0.85) contrast(1.05);
  transition: filter 0.4s, border-color 0.4s;
}

.tidbit-img:hover {
  filter: saturate(1) contrast(1);
  border-color: rgba(196, 168, 255, 0.3);
  cursor: pointer;
}

.tidbit-video-wrap {
  width: 100px;
  height: 75px;
  overflow: hidden;
  border-radius: 2px;
  border: 1px solid rgba(196, 168, 255, 0.1);
  flex-shrink: 0;
  transition: border-color 0.4s;
}

.tidbit-video-wrap:hover {
  border-color: rgba(196, 168, 255, 0.3);
}

.tidbit-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.05);
  transition: filter 0.4s;
  cursor: pointer;
}

.tidbit-video:hover {
  filter: saturate(1) contrast(1);
}

.tidbit-caption {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.2rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--lightbox-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 3px;
  border: 1px solid rgba(196, 168, 255, 0.15);
  box-shadow: 0 0 60px rgba(196, 168, 255, 0.08);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox.active .lightbox-img {
  transform: scale(1);
}

.lightbox-video {
  max-width: 45vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 3px;
  border: 1px solid rgba(196, 168, 255, 0.15);
  box-shadow: 0 0 60px rgba(196, 168, 255, 0.08);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: none;
}

.lightbox.active .lightbox-video {
  transform: scale(1);
}

.lightbox-clickable {
  cursor: pointer;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 2rem;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  transition: color 0.3s;
}

.lightbox-close:hover {
  color: var(--pink);
}

.footer {
  border-top: 1px solid var(--card-border);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-decoration {
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 0.5em;
  margin-bottom: var(--space-sm);
  animation: twinkle-icon 4s ease-in-out infinite;
}

.footer-text {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.footer-sub {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
  opacity: 0.7;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.footer-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: color 0.3s ease;
  opacity: 0.7;
}

.footer-icon:hover {
  color: var(--text-primary);
  opacity: 1;
}

.footer-icon svg {
  width: 100%;
  height: 100%;
}

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

@media (max-width: 640px) {
  :root {
    --space-xl: 3rem;
    --space-lg: 2rem;
  }

  .hero-name {
    font-size: clamp(1.8rem, 9vw, 3rem);
  }

  .hero-tagline {
    font-size: 0.8rem;
    flex-direction: column;
    gap: 0.3em;
  }

  .tag-sep {
    display: none;
  }

  .nav-links {
    gap: var(--space-sm);
  }

  .nav-links a {
    font-size: 0.8rem;
  }

  .portrait-frame {
    width: 160px;
    height: 160px;
  }

  .project-img {
    height: 140px;
  }

  .project-img-placeholder {
    height: 90px;
  }

  .about-stats {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .skill-tree {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-wrap: wrap;
  }

  .section-line {
    display: none;
  }

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

  .contact-grid {
    grid-template-columns: repeat(3, 1fr);
  }

}

@media (max-width: 380px) {
  .nav-links {
    gap: 0.5rem;
  }

  .nav-links a {
    font-size: 0.7rem;
  }
}

/* Menu-style quest list */
.quest-list {
  display: flex;
  flex-direction: column;
}

.quest-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0 var(--space-md);
  padding: 1rem 0;
  border-bottom: 1px solid var(--card-border);
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
}

.quest-entry:first-child {
  border-top: 1px solid var(--card-border);
}

.quest-entry:hover {
  opacity: 0.7;
}

.quest-entry-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  font-style: italic;
  color: var(--text-primary);
  grid-column: 1;
  grid-row: 1;
}

.quest-entry-meta {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-muted);
  grid-column: 2;
  grid-row: 1;
  text-align: right;
  align-self: center;
  font-style: italic;
}

.quest-entry-desc {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-secondary);
  grid-column: 1 / -1;
  grid-row: 2;
  margin-top: 0.2rem;
  line-height: 1.6;
}

/* Plain skills layout */
.skills-plain {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

@media (max-width: 640px) {
  .skills-plain {
    grid-template-columns: 1fr;
  }
}

.skills-group-plain {
  margin-bottom: 0;
}

.skills-group-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  font-style: italic;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

ul.skills-group-list {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.9;
  list-style: none;
  padding: 0;
}

ul.skills-group-list li::before {
  content: "–";
  color: var(--text-muted);
  margin-right: 0.5rem;
}

/* Section and entry rules */
.section-rule {
  border: none;
  border-top: 1px solid var(--card-border);
  margin: var(--space-md) 0;
}

.entry-rule {
  border: none;
  border-top: 1px solid var(--card-border);
  margin: var(--space-sm) 0;
}

/* Plain achievements */
.achievements-plain {
  margin-top: var(--space-sm);
}

.achievement-entry {
  padding: var(--space-sm) 0;
}

/* Lore entries */
.lore-entries {
  display: flex;
  flex-direction: column;
}

.lore-entry {
  padding: var(--space-sm) 0;
}
