/* DiGiT@L SouL — styles.css
   Design system, base reset, body styling. */

/* === Design tokens === */
:root {
  /* Colors — Pip-Boy phosphor CRT palette */
  --color-bg: #0A1410;
  --color-bg-elevated: #0E1B15;
  --color-fg: #DDE8DD;
  --color-fg-muted: #859585;
  --color-fg-subtle: #4A5A50;
  --color-accent: #CCFF00;
  --color-accent-hover: #DDFF33;
  --color-accent-glow: rgba(204, 255, 0, 0.18);
  --color-phosphor-glow: 0 0 8px rgba(204, 255, 0, 0.45);
  --color-phosphor-glow-soft: 0 0 6px rgba(204, 255, 0, 0.25);
  --color-border: #1E2A24;

  /* Typography */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Sizing */
  --max-content-width: 36rem;
  --sidebar-padding: 6rem;
  --section-spacing: 6rem;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-default: 300ms ease;
}

@media (max-width: 1023px) {
  :root {
    --sidebar-padding: 3rem;
    --section-spacing: 4rem;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--color-fg);
}

p {
  margin: 0 0 1em;
}

ul, ol {
  margin: 0;
  padding: 0;
}

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

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

button {
  font: inherit;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

::selection {
  background: var(--color-accent);
  color: var(--color-bg);
}

/* === Skip link === */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--color-accent);
  color: var(--color-bg);
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.25rem;
  z-index: 200;
  transition: top var(--transition-fast);
}
.skip-link:focus {
  top: 1rem;
  outline: 2px solid var(--color-fg);
  outline-offset: 2px;
}

/* === Focus rings === */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* === Selection text === */
strong {
  color: var(--color-fg);
  font-weight: 700;
}

/* === Layout (two columns on desktop) === */
.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  max-width: 90rem;
  margin: 0 auto;
  padding: 0 2rem;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: var(--sidebar-padding) 0;
  display: flex;
  flex-direction: column;
}
.sidebar__menu {
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
  gap: 1.5rem;
}

.content {
  padding: var(--sidebar-padding) 0;
  max-width: var(--max-content-width);
}

@media (max-width: 1023px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0 1.5rem;
  }
  .sidebar {
    position: static;
    height: auto;
    padding-bottom: 2rem;
  }
  .content {
    max-width: 100%;
    padding-top: 1rem;
  }
}

/* === Sidebar top: name, alias, tagline, intro === */
.sidebar__name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.25rem;
  color: var(--color-fg);
}

.sidebar__alias {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-fg-muted);
  margin: 0 0 1.5rem;
  letter-spacing: 0.02em;
}
.sidebar__alias span {
  color: var(--color-accent);
  font-weight: 500;
}

.sidebar__tagline {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--color-fg);
  margin: 0 0 1.5rem;
  line-height: 1.4;
}

.sidebar__intro {
  font-size: 0.9rem;
  color: var(--color-fg-muted);
  line-height: 1.5;
  margin: 0;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .sidebar__intro {
    white-space: normal;
  }
}
.sidebar__contact {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.85rem 0 0 0;
  padding: 0.45rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 0.45rem;
  overflow: hidden;
  transition: border-color var(--transition-default), transform var(--transition-default), box-shadow var(--transition-default);
}
.sidebar__contact::before {
  content: '';
  position: absolute;
  top: 0;
  left: -130%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(204, 255, 0, 0.18) 50%,
    transparent 100%
  );
  pointer-events: none;
  animation: contact-shimmer 5.5s ease-in-out infinite;
  z-index: 0;
}
@keyframes contact-shimmer {
  0%   { left: -130%; }
  55%  { left: 230%; }
  100% { left: 230%; }
}
.sidebar__contact-prompt {
  position: relative;
  z-index: 1;
  color: var(--color-accent);
  font-weight: 700;
  flex-shrink: 0;
  text-shadow: 0 0 6px rgba(204, 255, 0, 0.55);
  animation: contact-prompt-pulse 1.6s ease-in-out infinite;
}
@keyframes contact-prompt-pulse {
  0%, 100% { opacity: 0.55; transform: translateX(0); }
  50%      { opacity: 1;    transform: translateX(2px); }
}
.sidebar__contact-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--color-accent);
  text-decoration: none;
  transition: text-shadow var(--transition-fast);
}
.sidebar__contact-text {
  position: relative;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-fast);
}
.sidebar__contact-cta {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-bg);
  background: var(--color-accent);
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(204, 255, 0, 0.4);
  transform: translateX(-4px);
  opacity: 0;
  transition: transform var(--transition-default), opacity var(--transition-default);
}
.sidebar__contact:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px var(--color-accent), 0 6px 22px rgba(204, 255, 0, 0.3);
}
.sidebar__contact:hover .sidebar__contact-prompt {
  animation: none;
  opacity: 1;
  transform: translateX(3px);
}
.sidebar__contact:hover .sidebar__contact-text {
  border-bottom-color: var(--color-accent);
  text-shadow: 0 0 10px rgba(204, 255, 0, 0.55);
}
.sidebar__contact:hover .sidebar__contact-cta {
  transform: translateX(0);
  opacity: 1;
}
.sidebar__contact:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent), 0 6px 22px rgba(204, 255, 0, 0.3);
}
@media (prefers-reduced-motion: reduce) {
  .sidebar__contact::before,
  .sidebar__contact-prompt {
    animation: none;
  }
  .sidebar__contact-prompt {
    opacity: 1;
  }
}

/* === Sidebar navigation === */
.sidebar__nav {
  margin-top: 3rem;
}
.sidebar__nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0;
  text-decoration: none;
  color: inherit;
}
.nav-link__indicator {
  display: inline-block;
  width: 1.5rem;
  height: 1px;
  background: var(--color-fg-subtle);
  margin-right: 1rem;
  transition: width var(--transition-default), background var(--transition-default);
}
.nav-link:hover .nav-link__indicator,
.nav-link:focus-visible .nav-link__indicator,
.nav-link.is-active .nav-link__indicator {
  width: 4rem;
  background: var(--color-accent);
}
.nav-link__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-fg-muted);
  transition: color var(--transition-fast);
}
.nav-link:hover .nav-link__label,
.nav-link:focus-visible .nav-link__label,
.nav-link.is-active .nav-link__label {
  color: var(--color-fg);
}

@media (max-width: 1023px) {
  .sidebar__menu { display: none; }
}

/* === Sidebar social === */
.sidebar__social {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
}
.sidebar__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-fg-muted);
  transition: color var(--transition-fast), transform var(--transition-fast);
}
.sidebar__social a:hover,
.sidebar__social a:focus-visible {
  color: var(--color-fg);
  transform: translateY(-2px);
}
.sidebar__social svg {
  width: 1.5rem;
  height: 1.5rem;
}

@media (max-width: 1023px) {
  .sidebar__social {
    margin-top: 1.5rem;
  }
}

/* === Sections === */
.section {
  margin-bottom: var(--section-spacing);
  scroll-margin-top: 4rem;
}
.section:last-child {
  margin-bottom: 0;
}
.section__heading {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-fg);
  margin: 0 0 1.5rem;
  padding: 1rem 0;
  background: rgba(10, 20, 16, 0.85);
  backdrop-filter: blur(8px);
}
@media (min-width: 1024px) {
  .section__heading--sticky-mobile {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}
@media (max-width: 1023px) {
  .section__heading--sticky-mobile {
    position: sticky;
    top: 0;
    z-index: 20;
    margin: 0 -1.5rem 1.5rem;
    padding: 1rem 1.5rem;
  }
}

.section__body p {
  color: var(--color-fg-muted);
  margin: 0 0 1rem;
}
.section__body p:last-child {
  margin-bottom: 0;
}
.section__body strong {
  color: var(--color-fg);
}

/* === Experience list === */
.experience-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.experience-item {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 2.75rem;
  padding: 1rem;
  margin: 0 -1rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  transition: background var(--transition-default), border-color var(--transition-default);
}
.experience-item:hover {
  background: var(--color-bg-elevated);
  border-left-color: var(--color-accent);
}
.experience-item:hover .experience-item__role,
.experience-item:hover .experience-item__role a {
  color: var(--color-accent);
}

.experience-item__date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-fg-muted);
  padding-top: 0.25rem;
  white-space: nowrap;
}

.experience-item__body p {
  color: var(--color-fg-muted);
  font-size: 0.95rem;
  margin: 0.5rem 0;
}

.experience-item__role {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-fg);
  margin: 0;
  transition: color var(--transition-fast);
}
.experience-item__role a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}
.experience-item__role a:hover,
.experience-item__role a:focus-visible {
  color: var(--color-accent);
  text-decoration: none;
}

@media (max-width: 640px) {
  .experience-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

/* === Tags === */
.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
  padding: 0;
}
.tags li {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-accent);
  background: var(--color-accent-glow);
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

/* === Section CTA === */
.section__cta {
  margin-top: 2rem;
}
.section__cta a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--color-fg);
  border-bottom: 1px solid var(--color-fg-subtle);
  padding-bottom: 0.25rem;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.section__cta a:hover,
.section__cta a:focus-visible {
  color: var(--color-accent);
  border-color: var(--color-accent);
  text-decoration: none;
}

/* === Project grid === */
.project-grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 0;
  margin: 0;
}
@media (min-width: 720px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.project-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: transform var(--transition-default), border-color var(--transition-default), box-shadow var(--transition-default);
}
.project-card:hover {
  transform: scale(1.02);
  border-color: var(--color-accent);
  box-shadow: 0 0 24px var(--color-accent-glow);
}

.project-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.project-card__link:hover,
.project-card__link:focus-visible {
  text-decoration: none;
}

.project-card__image {
  width: 100%;
  height: 12rem;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--color-border);
}
.project-card__offline-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1rem;
  text-align: center;
  font-family: var(--font-mono);
  background:
    repeating-linear-gradient(
      45deg,
      transparent 0,
      transparent 16px,
      rgba(204, 255, 0, 0.07) 16px,
      rgba(204, 255, 0, 0.07) 32px
    ),
    var(--color-bg);
  overflow: hidden;
}
.project-card__offline-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 3px,
    rgba(0, 0, 0, 0.22) 3px,
    rgba(0, 0, 0, 0.22) 4px
  );
  pointer-events: none;
}
.project-card__offline-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, transparent 0%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
}
.project-card__offline-icon {
  position: relative;
  z-index: 1;
  font-size: 2.2rem;
  line-height: 1;
  color: var(--color-accent);
  text-shadow: 0 0 12px rgba(204, 255, 0, 0.55);
  animation: card-offline-blink 2.4s ease-in-out infinite;
}
.project-card__offline-title {
  position: relative;
  z-index: 1;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-fg);
}
.project-card__offline-cta {
  position: relative;
  z-index: 1;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
}
@keyframes card-offline-blink {
  0%, 100% { opacity: 1; }
  48%      { opacity: 0.3; }
  52%      { opacity: 0.3; }
}
@media (prefers-reduced-motion: reduce) {
  .project-card__offline-icon { animation: none; }
}

.project-card__body {
  padding: 1rem 1.25rem 1.25rem;
}

.project-card__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-fg);
  margin: 0 0 0.5rem;
  transition: color var(--transition-fast);
}
.project-card:hover .project-card__title {
  color: var(--color-accent);
}

.project-card__description {
  color: var(--color-fg-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* === Mix embeds === */
.mix-embeds {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
.mix-embeds__iframe {
  width: 100%;
  height: 9.5rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  background: var(--color-bg-elevated);
  transition: border-color var(--transition-default);
}
.mix-embeds__iframe:hover {
  border-color: var(--color-accent);
}
.music-subheading {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-fg-muted);
  margin: 1.75rem 0 0.85rem 0;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--color-border);
}
.music-frame {
  position: relative;
  border: 1px solid var(--color-accent);
  border-radius: 0.6rem;
  overflow: hidden;
  background: var(--color-bg-elevated);
  box-shadow: 0 0 0 1px rgba(204, 255, 0, 0.08), 0 0 14px rgba(204, 255, 0, 0.18);
  transition: box-shadow var(--transition-default), transform var(--transition-default), border-color var(--transition-default);
}
.music-frame:hover {
  box-shadow: 0 0 0 1px var(--color-accent), 0 0 22px rgba(204, 255, 0, 0.3);
  transform: translateY(-2px);
}
.music-frame iframe {
  display: block;
  width: 100%;
  border: 0;
}
.music-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.music-grid--hearthis {
  grid-template-columns: 1fr;
  gap: 0.6rem;
}
@media (min-width: 720px) {
  .music-grid--hearthis {
    grid-template-columns: repeat(2, 1fr);
  }
}
.music-cta {
  margin: 0.85rem 0 0 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-align: right;
}
.music-cta a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-fast), text-shadow var(--transition-fast);
}
.music-cta a:hover,
.music-cta a:focus-visible {
  border-bottom-color: var(--color-accent);
  text-shadow: 0 0 8px rgba(204, 255, 0, 0.4);
}

/* === Photo mosaic (static masonry gallery, CSS columns) === */
.photo-mosaic {
  column-count: 3;
  column-gap: 0.75rem;
}
@media (max-width: 900px) {
  .photo-mosaic { column-count: 2; }
}
@media (max-width: 540px) {
  .photo-mosaic { column-count: 1; }
}
.photo-item {
  break-inside: avoid;
  margin: 0 0 1.25rem;
  padding: 0;
}
.photo-item .photo-link {
  display: block;
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 0.25rem;
  aspect-ratio: auto;
  transition: filter var(--transition-default), transform var(--transition-default);
}
.photo-item .photo-link:hover,
.photo-item .photo-link:focus-visible {
  filter: brightness(1.08);
  transform: translateY(-2px);
}
.photo-item img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.25rem;
}
.photo-caption {
  margin: 0.5rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--color-fg-muted);
}
.photo-cta {
  margin: 1.5rem 0 0 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}
.photo-cta a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-fast), text-shadow var(--transition-fast);
}
.photo-cta a:hover,
.photo-cta a:focus-visible {
  border-bottom-color: var(--color-accent);
  text-shadow: 0 0 8px rgba(204, 255, 0, 0.4);
}

/* === Photo grid (legacy, kept for reference) === */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.photo-grid li {
  margin: 0;
}
.photo-grid__status {
  grid-column: 1 / -1;
  padding: 1.5rem 1rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-fg-muted);
  border: 1px dashed var(--color-border);
  border-radius: 0.5rem;
  background: var(--color-bg-elevated);
}
.photo-grid__status a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-fast);
}
.photo-grid__status a:hover,
.photo-grid__status a:focus-visible {
  border-bottom-color: var(--color-accent);
}
.photo-link--video {
  position: relative;
}
.photo-link__badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding-left: 2px;
  font-size: 0.7rem;
  color: var(--color-accent);
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--color-accent);
  border-radius: 50%;
  pointer-events: none;
  text-shadow: 0 0 6px rgba(204, 255, 0, 0.6);
}

/* === Sidebar header (avatar + identity row) === */
.sidebar__header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 0 0 1.5rem 0;
}
.sidebar__identity {
  flex: 1;
  min-width: 0;
}
.sidebar__identity .sidebar__name {
  font-size: clamp(1.6rem, 3.2vw, 2.25rem);
  margin: 0 0 0.35rem 0;
  line-height: 1.1;
}
.sidebar__identity .sidebar__alias {
  margin: 0;
}

/* === Sidebar avatar (Pip-Boy CRT screen) === */
.sidebar__avatar {
  position: relative;
  width: 110px;
  height: 110px;
  margin: 0;
  flex-shrink: 0;
  border-radius: 0.85rem;
  background: var(--color-bg);
  border: 1.5px solid var(--color-accent);
  box-shadow:
    0 0 0 1px rgba(204, 255, 0, 0.12),
    0 0 14px rgba(204, 255, 0, 0.22),
    inset 0 0 30px rgba(204, 255, 0, 0.12);
  overflow: hidden;
  transition: box-shadow var(--transition-default), transform var(--transition-default);
}
.sidebar__avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
  filter: contrast(1.05) brightness(1.05) saturate(0.95);
  transition: transform var(--transition-default), filter var(--transition-default);
}
.sidebar__avatar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.22) 2px,
    rgba(0, 0, 0, 0.22) 3px
  );
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: multiply;
  border-radius: inherit;
}
.sidebar__avatar::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 35%, transparent 0%, transparent 55%, rgba(0, 0, 0, 0.5) 100%),
    linear-gradient(180deg, transparent 0%, rgba(204, 255, 0, 0.18) 50%, transparent 100%);
  background-size: 100% 100%, 100% 25%;
  background-position: 0 0, 0 -25%;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 4;
  border-radius: inherit;
  animation: sidebar-avatar-scan 7s linear infinite;
}
@keyframes sidebar-avatar-scan {
  0% { background-position: 0 0, 0 -25%; }
  100% { background-position: 0 0, 0 130%; }
}
.sidebar__avatar:hover {
  box-shadow:
    0 0 0 1px rgba(204, 255, 0, 0.35),
    0 0 26px rgba(204, 255, 0, 0.55),
    inset 0 0 50px rgba(204, 255, 0, 0.25);
  transform: translateY(-2px);
}
.sidebar__avatar:hover .sidebar__avatar-img {
  transform: scale(1.06);
  filter: contrast(1.12) brightness(1.18) saturate(1) drop-shadow(2px 0 0 rgba(255, 0, 100, 0.55)) drop-shadow(-2px 0 0 rgba(0, 240, 255, 0.55));
  animation: sidebar-avatar-glitch 0.18s steps(2, end) infinite;
}
@keyframes sidebar-avatar-glitch {
  0%   { clip-path: inset(0 0 0 0); transform: scale(1.06) translate(0, 0); }
  20%  { clip-path: inset(8% 0 60% 0); transform: scale(1.06) translate(-1px, 1px); }
  40%  { clip-path: inset(0 0 0 0); transform: scale(1.06) translate(1px, -1px); }
  60%  { clip-path: inset(45% 0 25% 0); transform: scale(1.06) translate(-1px, -1px); }
  80%  { clip-path: inset(0 0 0 0); transform: scale(1.06) translate(1px, 1px); }
  100% { clip-path: inset(0 0 0 0); transform: scale(1.06) translate(0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar__avatar::after { animation: none; }
  .sidebar__avatar:hover .sidebar__avatar-img { animation: none; transform: none; filter: contrast(1.1) brightness(1.1); }
}

/* === Instagram profile card === */
.ig-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin: 0 0 1rem 0;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  text-decoration: none;
  color: var(--color-fg);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-default), transform var(--transition-default), box-shadow var(--transition-default);
}
.ig-profile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 3px,
    rgba(204, 255, 0, 0.025) 3px,
    rgba(204, 255, 0, 0.025) 4px
  );
  pointer-events: none;
  border-radius: inherit;
}
.ig-profile:hover,
.ig-profile:focus-visible {
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px var(--color-accent), 0 6px 28px rgba(204, 255, 0, 0.18);
  outline: none;
}
.ig-profile__avatar-ring {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 0deg, var(--color-accent), rgba(204, 255, 0, 0.25), var(--color-accent));
  display: grid;
  place-items: center;
  position: relative;
}
.ig-profile__avatar-ring::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(204, 255, 0, 0.35);
  pointer-events: none;
  animation: ig-ring-pulse 2.6s ease-in-out infinite;
}
.ig-profile__avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--color-bg);
  object-fit: cover;
  display: block;
}
.ig-profile__info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
  position: relative;
}
.ig-profile__handle {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--color-accent);
  letter-spacing: 0.02em;
  font-weight: 500;
  text-shadow: 0 0 8px rgba(204, 255, 0, 0.25);
}
.ig-profile__stats {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--color-fg-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ig-profile__count {
  color: var(--color-fg);
  font-weight: 700;
}
.ig-profile__sep {
  margin: 0 0.45rem;
  opacity: 0.5;
}
.ig-profile__cta {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}
.ig-profile__arrow {
  display: inline-block;
  transition: transform var(--transition-default);
}
.ig-profile:hover .ig-profile__arrow,
.ig-profile:focus-visible .ig-profile__arrow {
  transform: translateX(5px);
}
@keyframes ig-ring-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .ig-profile__avatar-ring,
  .ig-profile__avatar-ring::after,
  .ig-profile__arrow {
    animation: none;
    transition: none;
  }
}
@media (max-width: 540px) {
  .ig-profile {
    flex-wrap: wrap;
    padding: 0.85rem 1rem;
  }
  .ig-profile__cta {
    width: 100%;
    justify-content: flex-end;
    margin-top: 0.25rem;
  }
}
.photo-link {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
  border: 1px solid var(--color-border);
  aspect-ratio: 4 / 3;
  transition: border-color var(--transition-fast);
}
.photo-link:hover,
.photo-link:focus-visible {
  border-color: var(--color-accent);
}
.photo-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity var(--transition-fast), transform var(--transition-default);
}
.photo-link:hover img,
.photo-link:focus-visible img {
  opacity: 0.85;
  transform: scale(1.04);
}

/* === Lightbox (rendered by JS only) === */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 16, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 120;
  padding: 2rem;
  cursor: zoom-out;
}
.lightbox.is-open {
  display: flex;
}
.lightbox__image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0.5rem;
  border: 1px solid var(--color-border);
  box-shadow: 0 0 60px var(--color-accent-glow);
}
.lightbox__close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.lightbox__close:hover,
.lightbox__close:focus-visible {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* === Footer === */
.footer {
  margin-top: var(--section-spacing);
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}
.sidebar__copyright {
  margin: 1rem 0 0 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  line-height: 1.5;
  letter-spacing: 0.05em;
  color: var(--color-fg-muted);
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}
.sidebar__copyright-marker {
  color: var(--color-accent);
  font-size: 0.78rem;
  font-weight: 400;
  flex-shrink: 0;
  line-height: 1.4;
}
.sidebar__copyright-text {
  line-height: 1.5;
}
.sidebar__copyright-text strong {
  color: var(--color-fg);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.footer__text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-fg-subtle);
  line-height: 1.6;
  max-width: 28rem;
  margin: 0;
}
.footer__text strong {
  color: var(--color-fg-muted);
  font-weight: 500;
}
/* === CRT toggle button (lime by default; works in sidebar, resume back area, etc.) === */
.crt-toggle {
  background: none;
  border: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  text-shadow: var(--color-phosphor-glow-soft);
  cursor: pointer;
  transition: color var(--transition-fast), transform var(--transition-fast);
}
.crt-toggle:hover,
.crt-toggle:focus-visible {
  color: var(--color-accent-hover);
  transform: translateY(-2px);
}
.crt-toggle svg {
  width: 1.5rem;
  height: 1.5rem;
}
body.crt-off .crt-toggle {
  color: var(--color-fg-muted);
  text-shadow: none;
}

/* Floating CRT toggle (mobile only, fixed top-right under hamburger) */
.crt-toggle--floating {
  display: none;
}
@media (max-width: 1023px) {
  .crt-toggle--floating {
    position: fixed;
    top: calc(1.1rem + 44px + 0.5rem);
    right: 1.1rem;
    z-index: 109;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-accent);
    border-radius: 0.5rem;
    box-shadow: 0 0 0 1px rgba(204, 255, 0, 0.08), 0 0 12px rgba(204, 255, 0, 0.22);
  }
  .crt-toggle--floating:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-accent), 0 0 18px rgba(204, 255, 0, 0.4);
  }
  body.crt-off .crt-toggle--floating {
    border-color: var(--color-border);
    box-shadow: none;
  }
  body.is-menu-open .crt-toggle--floating {
    display: none;
  }
  body.bootup-active .crt-toggle--floating,
  body.bootup-active .hamburger {
    display: none;
  }
  /* Override the bouncy 'attention' animation on mobile floating button — use a shine sweep instead */
  .crt-toggle--floating.crt-toggle--attention {
    animation: none;
    overflow: hidden;
  }
  .crt-toggle--floating.crt-toggle--attention::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      110deg,
      transparent 0%,
      transparent 30%,
      rgba(204, 255, 0, 0.55) 50%,
      transparent 70%,
      transparent 100%
    );
    transform: translateX(-100%);
    animation: crt-toggle-shine 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
  }
  .crt-toggle--floating svg {
    position: relative;
    z-index: 1;
  }
  @keyframes crt-toggle-shine {
    0%   { transform: translateX(-100%); }
    30%  { transform: translateX(100%); }
    100% { transform: translateX(100%); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .crt-toggle--floating.crt-toggle--attention::before {
    animation: none;
    opacity: 0;
  }
}
/* Attention animation: a clear, multi-bounce pulse until the user clicks the toggle for the first time */
.crt-toggle--attention {
  animation: crt-toggle-attention 2.4s ease-out infinite;
}
@keyframes crt-toggle-attention {
  0% {
    transform: translateY(0);
    color: var(--color-accent);
    text-shadow: var(--color-phosphor-glow-soft);
  }
  8% {
    transform: translateY(-22px);
    color: var(--color-accent-hover);
    text-shadow: var(--color-phosphor-glow), 0 0 28px rgba(204, 255, 0, 0.75);
  }
  18% { transform: translateY(0); }
  26% { transform: translateY(-12px); }
  35% { transform: translateY(0); }
  41% { transform: translateY(-5px); }
  46% { transform: translateY(0); }
  50%, 100% {
    transform: translateY(0);
    color: var(--color-accent);
    text-shadow: var(--color-phosphor-glow-soft);
  }
}
@media (prefers-reduced-motion: reduce) {
  .crt-toggle--attention { animation: none; }
}

/* === CRT OFF: disable scanlines and phosphor glow on the site === */
body.crt-off {
  --color-phosphor-glow: none;
  --color-phosphor-glow-soft: none;
}
body.crt-off::before {
  display: none;
}
body.crt-off .cursor-blink {
  color: var(--color-fg-muted);
  text-shadow: none;
}

/* === Sidebar bottom (lang switch + social) === */
.sidebar__bottom {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* === Hamburger button (mobile only) === */
.hamburger {
  display: none;
}
@media (max-width: 1023px) {
  .hamburger {
    position: fixed;
    top: 1.1rem;
    right: 1.1rem;
    z-index: 110;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-accent);
    border-radius: 0.5rem;
    color: var(--color-accent);
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(204, 255, 0, 0.08), 0 0 12px rgba(204, 255, 0, 0.22);
    transition: box-shadow var(--transition-default), transform var(--transition-fast);
  }
  .hamburger:active { transform: scale(0.95); }
  .hamburger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-accent), 0 0 18px rgba(204, 255, 0, 0.4);
  }
}
.hamburger__bars {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 16px;
}
.hamburger__bar {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-accent);
  border-radius: 1px;
  box-shadow: 0 0 6px rgba(204, 255, 0, 0.5);
  transition: top 0.25s ease, transform 0.25s ease, opacity 0.2s ease;
}
.hamburger__bar:nth-child(1) { top: 0; }
.hamburger__bar:nth-child(2) { top: 7px; }
.hamburger__bar:nth-child(3) { top: 14px; }
body.is-menu-open .hamburger__bar:nth-child(1) {
  top: 7px;
  transform: rotate(45deg);
}
body.is-menu-open .hamburger__bar:nth-child(2) {
  opacity: 0;
}
body.is-menu-open .hamburger__bar:nth-child(3) {
  top: 7px;
  transform: rotate(-45deg);
}
@media (prefers-reduced-motion: reduce) {
  .hamburger__bar { transition: none; }
}

/* === Mobile menu overlay (full-screen Pip-Boy) === */
@media (max-width: 1023px) {
  body.is-menu-open {
    overflow: hidden;
  }
  body.is-menu-open .sidebar__menu {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    position: fixed;
    inset: 0;
    z-index: 105;
    padding: 5rem 2rem 2rem;
    background: var(--color-bg);
    overflow-y: auto;
    overscroll-behavior: contain;
    animation: mobile-menu-fade 0.25s ease-out;
  }
  body.is-menu-open .sidebar__menu::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 3px,
      rgba(204, 255, 0, 0.04) 3px,
      rgba(204, 255, 0, 0.04) 4px
    );
    pointer-events: none;
    z-index: 1;
  }
  body.is-menu-open .sidebar__menu > * {
    position: relative;
    z-index: 2;
  }
  body.is-menu-open .sidebar__nav ul {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }
  body.is-menu-open .nav-link {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--color-border);
  }
  body.is-menu-open .nav-link__label {
    font-size: 1.5rem;
    letter-spacing: 0.04em;
  }
  body.is-menu-open .nav-link__indicator {
    width: 1.5rem;
  }
  body.is-menu-open .sidebar__bottom {
    border-top: 1px solid var(--color-border);
    padding-top: 1.5rem;
  }
  body.is-menu-open .lang-switch {
    font-size: 1rem;
    align-self: center;
  }
  body.is-menu-open .sidebar__social {
    justify-content: center;
    gap: 1.5rem;
  }
}
@keyframes mobile-menu-fade {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  body.is-menu-open .sidebar__menu { animation: none; }
}

/* === Language switcher === */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.lang-switch__link {
  color: var(--color-fg-subtle);
  text-decoration: none;
  padding: 0.25rem 0;
  transition: color var(--transition-fast);
}
.lang-switch__link:hover,
.lang-switch__link:focus-visible {
  color: var(--color-fg);
}
.lang-switch__link.is-active {
  color: var(--color-accent);
  text-shadow: var(--color-phosphor-glow-soft);
}
.lang-switch__sep {
  color: var(--color-fg-subtle);
}

.resume__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0 0 2.5rem;
}
.resume__topbar .resume__back { margin: 0; }
.resume__topbar-end {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

/* === Resume page === */
.resume-page {
  min-height: 100vh;
}
.resume {
  max-width: 44rem;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) clamp(1.25rem, 4vw, 2rem);
}
.resume__back {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 2.5rem;
}
.resume__back a {
  color: var(--color-fg-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.resume__back a:hover,
.resume__back a:focus-visible {
  color: var(--color-accent);
  text-shadow: var(--color-phosphor-glow-soft);
}
.resume__back--bottom {
  margin: 4rem 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.resume__back--bottom a {
  margin: 0;
}

.resume__header {
  text-align: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}
.resume__name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.resume__alias {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-fg-muted);
  margin: 0.25rem 0 1rem;
}
.resume__alias span {
  color: var(--color-accent);
  text-shadow: var(--color-phosphor-glow-soft);
}
.resume__role {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-fg);
  margin: 0 0 0.75rem;
}
.resume__contact {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--color-fg-muted);
  margin: 0;
}
.resume__contact a {
  color: var(--color-fg-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.resume__contact a:hover,
.resume__contact a:focus-visible {
  color: var(--color-accent);
  text-shadow: var(--color-phosphor-glow-soft);
}

.resume__section {
  margin-bottom: 3rem;
}
.resume__heading {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-accent);
  margin: 0 0 1.25rem;
  text-shadow: var(--color-phosphor-glow-soft);
}
.resume__heading::before { content: "[ "; color: var(--color-accent); }
.resume__heading::after { content: " ]"; color: var(--color-accent); }

.resume__body p {
  color: var(--color-fg-muted);
  margin: 0 0 1rem;
}
.resume__body p:last-child { margin-bottom: 0; }
.resume__body strong { color: var(--color-fg); }

.resume__bullets {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.resume__bullets li {
  position: relative;
  padding-left: 1.25rem;
  color: var(--color-fg-muted);
  font-size: 0.95rem;
}
.resume__bullets li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-family: var(--font-mono);
}

.resume__skills {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem 1rem;
}
@media (min-width: 600px) {
  .resume__skills {
    grid-template-columns: 1fr 1fr;
  }
}
.resume__skills li {
  position: relative;
  padding-left: 1.25rem;
  color: var(--color-fg-muted);
  font-size: 0.95rem;
}
.resume__skills li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-family: var(--font-mono);
}

.resume__lang-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.resume__lang-list li {
  color: var(--color-fg-muted);
  font-size: 0.95rem;
}
.resume__lang-list strong {
  color: var(--color-fg);
  display: inline-block;
  min-width: 6rem;
}

.experience-item__location {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--color-fg-subtle);
  text-transform: uppercase;
  margin: 0.25rem 0 0.5rem;
}

/* === 404 page (Pip-Boy CRT crash screen) === */
.page-404 {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 2rem 1.5rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(204, 255, 0, 0.05) 0%, transparent 65%),
    var(--color-bg);
}
.page-404::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 3px,
    rgba(204, 255, 0, 0.05) 3px,
    rgba(204, 255, 0, 0.05) 4px
  );
}
.page-404::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse at 50% 50%, transparent 0%, transparent 65%, rgba(0, 0, 0, 0.45) 100%);
}

.not-found {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 56rem;
}

.not-found__kicker {
  font-family: var(--font-mono);
  font-size: clamp(0.7rem, 1.6vw, 0.85rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 0.5rem;
  text-shadow: 0 0 8px rgba(204, 255, 0, 0.5);
  animation: not-found-kicker-flicker 3.6s steps(1, end) infinite;
}
@keyframes not-found-kicker-flicker {
  0%, 92%, 100% { opacity: 1; }
  93% { opacity: 0.35; }
  95% { opacity: 1; }
  96% { opacity: 0.55; }
  97% { opacity: 1; }
}

.not-found__hero {
  position: relative;
  margin: 0.5rem 0 1.25rem;
  line-height: 0.85;
  display: flex;
  justify-content: center;
}

.not-found__glitch {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(7rem, 22vw, 18rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--color-accent);
  text-shadow: 0 0 50px rgba(204, 255, 0, 0.45), 0 0 12px rgba(204, 255, 0, 0.35);
  line-height: 0.85;
}
.not-found__glitch::before,
.not-found__glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.not-found__glitch::before {
  color: rgba(255, 0, 100, 0.85);
  animation: not-found-glitch-1 2.6s infinite linear alternate-reverse;
  mix-blend-mode: screen;
}
.not-found__glitch::after {
  color: rgba(0, 240, 255, 0.85);
  animation: not-found-glitch-2 2.1s infinite linear alternate-reverse;
  mix-blend-mode: screen;
}
@keyframes not-found-glitch-1 {
  0%   { clip-path: inset(40% 0 50% 0); transform: translate(-3px, -1px); }
  20%  { clip-path: inset(80% 0 5% 0);  transform: translate(-2px, 1px);  }
  40%  { clip-path: inset(15% 0 70% 0); transform: translate(-3px, 0);    }
  60%  { clip-path: inset(55% 0 30% 0); transform: translate(-2px, -1px); }
  80%  { clip-path: inset(25% 0 60% 0); transform: translate(-3px, 1px);  }
  100% { clip-path: inset(70% 0 15% 0); transform: translate(-2px, 0);    }
}
@keyframes not-found-glitch-2 {
  0%   { clip-path: inset(60% 0 25% 0); transform: translate(3px, 1px);   }
  20%  { clip-path: inset(10% 0 75% 0); transform: translate(2px, -1px);  }
  40%  { clip-path: inset(45% 0 40% 0); transform: translate(3px, 0);     }
  60%  { clip-path: inset(20% 0 65% 0); transform: translate(2px, 1px);   }
  80%  { clip-path: inset(70% 0 10% 0); transform: translate(3px, -1px);  }
  100% { clip-path: inset(35% 0 50% 0); transform: translate(2px, 0);     }
}

.not-found__title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.6vw, 1.6rem);
  font-weight: 500;
  color: var(--color-fg);
  margin: 0 0 1.75rem;
  letter-spacing: 0.01em;
}

.not-found__diagnostic {
  display: inline-block;
  text-align: left;
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 1.6vw, 0.88rem);
  line-height: 1.65;
  color: var(--color-fg-muted);
  padding: 1rem 1.25rem;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 0.55rem;
  margin: 0 0 2rem;
  white-space: pre;
  overflow-x: auto;
  max-width: 100%;
  box-shadow: 0 0 0 1px rgba(204, 255, 0, 0.05), 0 0 18px rgba(204, 255, 0, 0.12);
}
.not-found__diagnostic .diag-path {
  color: var(--color-accent);
  text-shadow: 0 0 6px rgba(204, 255, 0, 0.4);
  word-break: break-all;
}

.not-found__actions {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
  flex-wrap: wrap;
}
.not-found__cta {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-fg-muted);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  text-decoration: none;
  transition: color var(--transition-fast), border-color var(--transition-default), box-shadow var(--transition-default), transform var(--transition-fast);
}
.not-found__cta:hover,
.not-found__cta:focus-visible {
  color: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent), 0 0 20px rgba(204, 255, 0, 0.3);
  transform: translateY(-2px);
  outline: none;
}
.not-found__cta--primary {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: rgba(204, 255, 0, 0.04);
}

.not-found__scan {
  position: fixed;
  left: 0;
  right: 0;
  top: -10%;
  height: 4px;
  background: linear-gradient(180deg, transparent 0%, rgba(204, 255, 0, 0.6) 50%, transparent 100%);
  pointer-events: none;
  z-index: 1;
  animation: not-found-scan-beam 6s linear infinite;
  filter: blur(1px);
}
@keyframes not-found-scan-beam {
  0%   { transform: translateY(0); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(120vh); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .not-found__kicker,
  .not-found__glitch::before,
  .not-found__glitch::after,
  .not-found__scan { animation: none; }
}

/* === Scroll-triggered fade-in (only when JS is active) === */
.section { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  body.js-ready .section:not(.is-visible) {
    opacity: 0;
    transform: translateY(20px);
  }
  body.js-ready .section.is-visible {
    opacity: 1;
    transform: none;
    transition: opacity 600ms ease, transform 600ms ease;
  }
}

/* === Inline links inside main === */
main a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}
main a:hover,
main a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.2em;
  color: var(--color-accent-hover);
}

/* === Spotlight cursor (progressive enhancement) === */
.spotlight {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  background: radial-gradient(
    420px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(204, 255, 0, 0.06),
    transparent 55%
  );
  opacity: 0;
  transition: opacity var(--transition-default);
}
body.has-spotlight .spotlight {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .spotlight { display: none; }
}

/* === CRT phosphor screen — scanlines always on (subtle on site pages) === */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.32),
    rgba(0, 0, 0, 0.32) 1px,
    transparent 1px,
    transparent 3px
  );
}

/* === Phosphor glow on accent text === */
.sidebar__alias span,
.tags li {
  text-shadow: var(--color-phosphor-glow-soft);
}
main a:hover,
main a:focus-visible {
  text-shadow: var(--color-phosphor-glow-soft);
}
.cursor-blink {
  display: inline-block;
  margin-left: 0.15em;
  color: var(--color-accent);
  text-shadow: var(--color-phosphor-glow);
  animation: cursor-blink 1.1s steps(2, jump-none) infinite;
}
@keyframes cursor-blink {
  50% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .cursor-blink { animation: none; }
}

/* === Power-on screen (pre-boot, unlocks audio) === */
.powerup {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: clamp(1.5rem, 5vw, 3rem);
  /* Force CRT phosphor visuals on the power-on screen too */
  --color-phosphor-glow: 0 0 8px rgba(204, 255, 0, 0.45);
  --color-phosphor-glow-soft: 0 0 6px rgba(204, 255, 0, 0.25);
  opacity: 1;
  transition: opacity 280ms ease;
}
.powerup.is-fading { opacity: 0; pointer-events: none; }
.powerup::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.55),
    rgba(0, 0, 0, 0.55) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 1;
}
.powerup__button {
  position: relative;
  z-index: 2;
  background: transparent;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  text-shadow: var(--color-phosphor-glow);
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 2.8vw, 1.6rem);
  letter-spacing: 0.2em;
  padding: 1.4rem 2.8rem;
  cursor: pointer;
  border-radius: 0.5rem;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}
.powerup__button:hover,
.powerup__button:focus-visible {
  background: var(--color-accent-glow);
  box-shadow: 0 0 30px var(--color-accent-glow);
  transform: translateY(-2px);
  outline: none;
}
.powerup__button:active {
  transform: translateY(0);
}
.powerup__hint {
  position: relative;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-fg);
  margin: 0;
  text-align: center;
}

/* === Boot-up sequence (Pip-Boy style) === */
.bootup {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 3rem);
  overflow-y: auto;
  cursor: pointer;
  opacity: 1;
  transition: opacity 400ms ease;
  /* Force CRT phosphor visuals inside the boot-up regardless of toggle state */
  --color-phosphor-glow: 0 0 8px rgba(204, 255, 0, 0.45);
  --color-phosphor-glow-soft: 0 0 6px rgba(204, 255, 0, 0.25);
}
/* Scanlines specific to the boot-up overlay, always visible regardless of CRT toggle */
.bootup::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.55),
    rgba(0, 0, 0, 0.55) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 1;
}
/* Force cursor blink inside boot-up regardless of CRT toggle */
.bootup .cursor-blink {
  animation: cursor-blink 1.1s steps(2, jump-none) infinite;
  color: var(--color-accent);
  text-shadow: var(--color-phosphor-glow);
}
/* === Boot-up CRT monitor — outer dark plastic case (the "cornice") === */
.bootup__monitor {
  position: relative;
  z-index: 3;
  max-width: 54rem;
  width: 100%;
  padding: clamp(1.25rem, 2.5vw, 2rem) clamp(1.25rem, 2.5vw, 2rem) clamp(2.25rem, 4vw, 3.25rem);
  background:
    linear-gradient(180deg, #1c1c20 0%, #131317 45%, #181820 100%);
  border-radius: clamp(28px, 4vw, 52px);
  box-shadow:
    /* top plastic highlight */
    inset 0 2px 1px rgba(255, 255, 255, 0.07),
    /* sides + bottom shadow on the case for plastic depth */
    inset 0 -3px 6px rgba(0, 0, 0, 0.6),
    inset 2px 0 4px rgba(0, 0, 0, 0.3),
    inset -2px 0 4px rgba(0, 0, 0, 0.3),
    /* outer drop shadow lifting the monitor off the bg */
    0 30px 80px rgba(0, 0, 0, 0.8),
    /* thin outer edge */
    0 0 0 1px rgba(255, 255, 255, 0.04);
}
/* Subtle "power LED" dot at the bottom-right of the bezel */
.bootup__monitor::before {
  content: "";
  position: absolute;
  bottom: clamp(0.85rem, 1.5vw, 1.25rem);
  right: clamp(1.5rem, 2.5vw, 2rem);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 8px rgba(204, 255, 0, 0.7), 0 0 2px rgba(255, 255, 255, 0.4);
}

/* === Boot-up phosphor screen — inner convex display === */
.bootup__screen {
  position: relative;
  padding: clamp(1.5rem, 4vw, 2.75rem) clamp(1.25rem, 4vw, 2.75rem);
  border-radius: clamp(18px, 2.6vw, 32px);
  background:
    /* convex phosphor vignette: bright center, dark edges */
    radial-gradient(
      ellipse 100% 100% at center,
      rgba(204, 255, 0, 0.08) 0%,
      transparent 22%,
      rgba(0, 0, 0, 0.30) 60%,
      rgba(0, 0, 0, 0.7) 88%,
      rgba(0, 0, 0, 0.90) 100%
    ),
    /* base screen color */
    #0a1410;
  box-shadow:
    /* thin lime edge marking the live display surface */
    inset 0 0 0 1px rgba(204, 255, 0, 0.28),
    /* inner shadow making the screen feel recessed into the bezel */
    inset 0 6px 20px rgba(0, 0, 0, 0.85),
    inset 0 -3px 12px rgba(0, 0, 0, 0.5),
    inset 4px 0 12px rgba(0, 0, 0, 0.4),
    inset -4px 0 12px rgba(0, 0, 0, 0.4);
}
/* Scanlines INSIDE the screen — overlay the boot content like a real CRT */
.bootup__screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  border-radius: inherit;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.55),
    rgba(0, 0, 0, 0.55) 1px,
    transparent 1px,
    transparent 3px
  );
}
/* Glass highlight at top of the screen — the convex curve catching light */
.bootup__screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  border-radius: inherit;
  background: radial-gradient(
    ellipse 70% 25% at 50% 0%,
    rgba(204, 255, 0, 0.10),
    transparent 70%
  );
}
/* Boot content sits above bg, below scanlines */
.bootup__screen > * {
  position: relative;
  z-index: 1;
}
.bootup.is-fading { opacity: 0; pointer-events: none; }
.bootup--picker { cursor: default; }
.bootup__lines {
  font-family: var(--font-mono);
  color: var(--color-accent);
  text-shadow: var(--color-phosphor-glow);
  font-size: clamp(0.75rem, 1.6vw, 0.95rem);
  line-height: 1.9;
  margin: 0;
  white-space: pre-wrap;
  max-width: 44rem;
  width: 100%;
}
.bootup__line {
  display: block;
  opacity: 0;
  animation: bootup-line-in 0.25s ease forwards;
}
.bootup__line:nth-child(1) { animation-delay: 0.10s; }
.bootup__line:nth-child(2) { animation-delay: 0.45s; }
.bootup__line:nth-child(3) { animation-delay: 0.80s; }
.bootup__line:nth-child(4) { animation-delay: 1.15s; }
.bootup__line:nth-child(5) { animation-delay: 1.50s; }
.bootup__line:nth-child(6) {
  animation-delay: 1.85s;
  font-size: 1.1em;
}
.bootup__hint {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-fg-subtle);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  animation: bootup-line-in 0.4s ease 2.4s forwards;
}

/* === Boot-up language picker === */
.bootup__picker {
  margin-top: 2.5rem;
  width: 100%;
  text-align: left;
}
.bootup__picker-prompt {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  color: var(--color-fg);
  text-shadow: var(--color-phosphor-glow-soft);
  letter-spacing: 0.12em;
  margin: 0 0 1.5rem;
  opacity: 0;
  animation: bootup-line-in 0.4s ease 2.3s forwards;
}
.bootup__picker-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
  opacity: 0;
  animation: bootup-line-in 0.4s ease 2.7s forwards;
}
.bootup__lang {
  background: transparent;
  border: 1px solid var(--color-fg-subtle);
  border-radius: 0.25rem;
  padding: 0.95rem 1.5rem;
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 2.4vw, 1.2rem);
  letter-spacing: 0.15em;
  color: var(--color-fg-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast), text-shadow var(--transition-fast), transform var(--transition-fast);
}
.bootup__lang:hover,
.bootup__lang:focus-visible {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: var(--color-accent-glow);
  text-shadow: var(--color-phosphor-glow);
  transform: translateY(-1px);
  outline: none;
}
.bootup__lang-key {
  color: var(--color-accent);
  font-weight: 500;
  text-shadow: var(--color-phosphor-glow-soft);
  letter-spacing: 0.05em;
}
.bootup__lang:hover .bootup__lang-key,
.bootup__lang:focus-visible .bootup__lang-key {
  text-shadow: var(--color-phosphor-glow);
}
.bootup__picker-hint {
  margin: 1.5rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-fg);
  opacity: 0;
  animation: bootup-line-in 0.4s ease 3.1s forwards;
}
@keyframes bootup-line-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .bootup { display: none; }
}

/* === Terminal bracket styling on mobile sticky headings === */
@media (max-width: 1023px) {
  .section__heading--sticky-mobile::before {
    content: "[ ";
    color: var(--color-accent);
    text-shadow: var(--color-phosphor-glow-soft);
  }
  .section__heading--sticky-mobile::after {
    content: " ]";
    color: var(--color-accent);
    text-shadow: var(--color-phosphor-glow-soft);
  }
}
