/* ==========================================================================
   whilelost.dev — Modern Minimalist Design System
   Benchmark: Paco Coursey (paco.me) & Rauno Freiberg (rauno.me)
   ========================================================================== */

/* Design Tokens & Theme Variables */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, "Cascadia Code", monospace;

  /* Deep Atmospheric Dark Theme */
  --bg-page: #08080a;
  --bg-page-rgb: 8, 8, 10;
  --bg-surface: #0e0f12;
  --bg-surface-hover: #15161b;
  --bg-elevated: #1a1b22;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-muted: rgba(255, 255, 255, 0.04);
  --border-highlight: rgba(255, 255, 255, 0.16);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #8b949e;
  --accent-emerald: #10b981;
  --accent-emerald-dim: rgba(16, 185, 129, 0.15);
  
  --accent-amber: #f59e0b;
  --accent-amber-dim: rgba(245, 158, 11, 0.12);
  
  --selection-bg: rgba(16, 185, 129, 0.25);
  --selection-text: #ffffff;
  --focus-ring: #10b981;
  --code-bg: #121318;
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px -6px rgba(0, 0, 0, 0.45);
  --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.3), 0 20px 42px -10px rgba(0, 0, 0, 0.65);
  --shadow-dropdown: 0 16px 40px -8px rgba(0, 0, 0, 0.6), 0 4px 16px -2px rgba(0, 0, 0, 0.4);
  
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-page: #fafaf9;
  --bg-page-rgb: 250, 250, 249;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f5f5f4;
  --bg-elevated: #e7e5e4;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-muted: rgba(0, 0, 0, 0.04);
  --border-highlight: rgba(0, 0, 0, 0.16);
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --accent-emerald: #059669;
  --accent-emerald-dim: rgba(5, 150, 105, 0.12);
  
  --accent-amber: #d97706;
  --accent-amber-dim: rgba(217, 119, 6, 0.1);
  
  --selection-bg: rgba(5, 150, 105, 0.2);
  --selection-text: #0f172a;
  --focus-ring: #059669;
  --code-bg: #f1f5f9;
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px -6px rgba(0, 0, 0, 0.07);
  --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.06), 0 20px 40px -10px rgba(0, 0, 0, 0.12);
  --shadow-dropdown: 0 16px 40px -8px rgba(0, 0, 0, 0.12), 0 4px 16px -2px rgba(0, 0, 0, 0.06);
}

/* Browser Surfaces Theming */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  color-scheme: dark light;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  background-color: var(--bg-page);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  overflow-x: hidden;
  max-width: 100%;
}

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

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Tabular figures for numbers, dates, times */
/* ==========================================================================
   Atmospheric Constellation Star-Track Background (Concept #5)
   ========================================================================== */
.constellation-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 1;
  transition: opacity 0.5s var(--ease-out-expo);
}

.constellation-canvas.is-hidden {
  opacity: 0;
}

.site-header,
.page-shell,
.site-footer {
  position: relative;
  z-index: 1;
}

#constellation-toggle.constellation-active {
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.35);
  background-color: var(--accent-emerald-dim);
}

#constellation-toggle.constellation-active svg circle {
  fill: var(--accent-emerald);
}

.tabular-nums, time, .stat-value, .meta-time, .keyboard-shortcut {
  font-variant-numeric: tabular-nums;
}

/* Scrollbar Theming */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-page);
}

::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Typography Hierarchy */
h1, h2, h3, h4 {
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h1 {
  font-size: 2.25rem;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

h2 {
  font-size: 1.25rem;
  line-height: 1.35;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1rem;
  line-height: 1.4;
  margin-bottom: 0.35rem;
}

p {
  margin-bottom: 1rem;
  max-width: 68ch;
}

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 4px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--text-primary);
}

/* Layout Container */
.container {
  width: 100%;
  max-width: 1460px;
  margin: 0 auto;
  padding: 0 clamp(1.75rem, 3.8vw, 4.25rem);
}

/* Header & Controls */
.site-header {
  padding: 2.25rem 0 1.5rem;
  border-bottom: 1px solid var(--border-muted);
  animation: page-arrive 0.6s var(--ease-out-expo) both;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
  letter-spacing: -0.015em;
  transition: opacity 0.15s ease;
}

.brand:hover {
  opacity: 0.85;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.icon-button {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow-subtle);
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.15s var(--ease-out-expo);
}

.icon-button:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--border-highlight);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.icon-button:active {
  transform: translateY(0) scale(0.96);
}

.icon-button svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.75;
}

.kbd-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.1rem 0.35rem;
  background: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-muted);
  position: absolute;
  bottom: -6px;
  right: -6px;
  line-height: 1;
}

/* Page Shell & Layout Split (Mobile-First Architecture) */
.page-shell {
  padding: clamp(3.25rem, 5vw, 5rem) 0 clamp(5rem, 7vw, 7.5rem);
  flex: 1;
}

/* Mobile-first: single column stacked layout */
.layout-split {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
  width: 100%;
}

.discord-popout-col {
  display: none;
}

/* Desktop layout: multi-column split (>= 960px) */
@media (min-width: 960px) {
  .layout-split {
    display: grid;
    grid-template-columns: 285px minmax(0, 1fr);
    gap: clamp(2.5rem, 3.8vw, 4.5rem);
    align-items: stretch;
  }

  .sidebar-col {
    position: relative;
    height: 100%;
    align-self: stretch;
  }

  .sidebar-sticky {
    position: sticky;
    top: 3rem;
  }

  .smooth-follow-active .sidebar-sticky {
    position: relative;
    top: 0;
    will-change: transform;
  }

  .layout-split:has(.discord-card, .instagram-card) {
    grid-template-columns: 285px minmax(0, 1fr) 305px;
  }

  .layout-split:has(.discord-card, .instagram-card) .discord-popout-col {
    display: block;
  }
}

.sidebar-col {
  min-width: 0;
  animation: page-arrive 0.65s var(--ease-out-expo) 0.06s both;
}

.discord-popout-col {
  min-width: 0;
  animation: page-arrive 0.75s var(--ease-out-expo) 0.18s both;
}

.content-col {
  min-width: 0;
  animation: page-arrive 0.7s var(--ease-out-expo) 0.12s both;
}

.discord-popout-sticky {
  position: sticky;
  top: 3rem;
}

.sidebar-sticky {
  position: sticky;
  top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.profile-lockup {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

/* Avatar: Tactile Monogram Stamp */
.avatar-mark {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  background: linear-gradient(135deg, #1b1c24 0%, #0d0e12 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 4px 14px rgba(0, 0, 0, 0.4);
  position: relative;
  user-select: none;
  transition: transform 0.22s var(--ease-out-expo), border-color 0.2s ease, box-shadow 0.22s ease;
}

.avatar-mark:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 20px rgba(0, 0, 0, 0.5);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.avatar-status-pip {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  border: 2px solid var(--bg-page);
  z-index: 2;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.avatar-status-pip.status-online {
  background-color: var(--accent-emerald);
  box-shadow: 0 0 0 2px var(--bg-surface);
}

.avatar-status-pip.status-idle {
  background-color: var(--accent-amber);
  box-shadow: 0 0 0 2px var(--bg-surface);
}

.avatar-status-pip.status-dnd {
  background-color: #ef4444;
  box-shadow: 0 0 0 2px var(--bg-surface);
}

.avatar-status-pip.status-offline {
  background-color: var(--text-muted);
  box-shadow: none;
}

.profile-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.profile-titles h1 {
  margin-bottom: 0.25rem;
  font-size: clamp(1.2rem, 1.55vw, 1.38rem);
  line-height: 1.25;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.profile-sub {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.hero-bio {
  font-size: 0.96rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0;
}

/* Top Contact Bar */
.top-contact-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.8rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  text-decoration: none;
  cursor: pointer;
  line-height: 1;
  box-shadow: var(--shadow-subtle);
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.15s var(--ease-out-expo);
}

.contact-chip:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--border-highlight);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.contact-chip:active {
  transform: translateY(0) scale(0.97);
}

.contact-chip svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.chip-action-indicator {
  width: 11px !important;
  height: 11px !important;
  opacity: 0.45;
  margin-left: -0.1rem;
  transition: opacity 0.15s ease, transform 0.15s var(--ease-out-expo);
}

.contact-chip:hover .chip-action-indicator {
  opacity: 0.95;
}

a.contact-chip:hover .chip-action-indicator {
  transform: translate(1px, -1px);
}

/* Sidebar Ambient Presence: Unified Minimalist Format (Above Bio) */
.sidebar-presence-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: transparent;
  border: none;
}

.presence-list-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.815rem;
  line-height: 1.45;
}

.presence-list-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
}

.presence-list-icon svg {
  width: 13.5px;
  height: 13.5px;
  stroke-width: 1.75;
}

.presence-list-content {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 0.25rem;
}

.presence-primary {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.815rem;
  letter-spacing: -0.01em;
}

.presence-primary.font-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.presence-secondary {
  color: var(--text-muted);
  font-size: 0.79rem;
  font-weight: 400;
}

.presence-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 0.25rem;
  transition: color 0.15s ease;
}

.presence-link:hover .presence-primary {
  color: var(--accent-emerald);
}

.presence-link:hover .presence-secondary {
  color: var(--text-secondary);
}

/* Status indicator dot with pulse */
.status-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.status-online {
  background-color: var(--accent-emerald, #10b981);
  box-shadow: 0 0 0 2px var(--bg-surface);
}

.status-idle {
  background-color: var(--accent-amber, #f59e0b);
  box-shadow: 0 0 0 2px var(--bg-surface);
}

.status-dnd {
  background-color: #ef4444;
  box-shadow: 0 0 0 2px var(--bg-surface);
}

.status-offline {
  background-color: var(--text-muted, #8b949e);
  box-shadow: none;
}

/* Spotify mini wave bars */
.music-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 12px;
  width: 10px;
  flex-shrink: 0;
}

.music-bars span {
  width: 2px;
  background-color: var(--text-muted);
  border-radius: 1px;
  height: 3px;
  transition: background-color 0.2s ease;
}

.music-bars.playing span {
  background-color: var(--accent-emerald, #10b981);
  animation: music-wave 1.1s cubic-bezier(0.25, 1, 0.5, 1) infinite alternate;
}

.music-bars.playing span:nth-child(1) { height: 40%; animation-delay: 0.1s; }
.music-bars.playing span:nth-child(2) { height: 100%; animation-delay: 0.35s; }
.music-bars.playing span:nth-child(3) { height: 60%; animation-delay: 0.2s; }

@keyframes music-wave {
  0% { height: 3px; }
  100% { height: 12px; }
}

/* Content Navigation Filter Tabs */
.content-nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  margin-bottom: 2.25rem;
  flex-wrap: wrap;
}

.admin-manage-pages-btn,
.admin-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.34rem 0.75rem;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.08) !important;
  border: 1px solid rgba(16, 185, 129, 0.28) !important;
  color: var(--accent-emerald) !important;
  font-size: 0.76rem;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  outline: none;
}

.admin-manage-pages-btn:hover,
.admin-action-btn:hover {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: rgba(16, 185, 129, 0.5) !important;
  transform: translateY(-1px);
}

/* Garden Nav Tabs (Tactile Segmented Control) */
.nav-track {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 3px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-track::-webkit-scrollbar {
  display: none;
}

.nav-pill {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.38rem 0.88rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s var(--ease-out-expo);
}

.nav-pill:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-hover);
}

.nav-pill.active {
  color: var(--text-primary);
  background-color: var(--bg-page);
  border-color: var(--border-muted);
  box-shadow: var(--shadow-subtle);
}

/* Garden Content Modules */
.garden-content {
  padding: 0 0 3rem;
  display: flex;
  flex-direction: column;
  gap: 4.5rem;
}

.garden-sector {
  display: flex;
  flex-direction: column;
  animation: sector-reveal 0.35s var(--ease-out-expo) both;
}

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

.sector-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.35rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-muted);
}

.sector-title {
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  margin: 0;
}

.sector-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* Works & Experiments List */
.works-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1.5rem;
}

.work-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.65rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  height: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s var(--ease-out-expo), box-shadow 0.25s var(--ease-out-expo), border-color 0.2s ease, background-color 0.2s ease;
}

.work-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.work-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background-color: var(--bg-surface-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

.work-card:hover::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.work-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.work-title-link {
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  letter-spacing: -0.015em;
}

.work-title-link svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.25;
  opacity: 0.65;
  transition: transform 0.25s var(--ease-out-expo), opacity 0.2s ease, color 0.2s ease;
}

.work-card:hover .work-title-link svg {
  transform: translate(3px, -3px);
  opacity: 1;
  color: var(--accent-emerald);
}

.work-year {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  background: var(--code-bg);
  border: 1px solid var(--border-muted);
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.work-desc {
  font-size: 0.93rem;
  color: var(--text-secondary);
  line-height: 1.64;
  margin-bottom: auto;
}

.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-top: 0.45rem;
}

.tag-badge {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  background: var(--code-bg);
  border: 1px solid var(--border-muted);
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.work-card:hover .tag-badge {
  border-color: rgba(255, 255, 255, 0.09);
  color: var(--text-secondary);
}

/* Writing & Notes List */
.writing-list {
  display: flex;
  flex-direction: column;
}

.writing-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.95rem 0;
  border-bottom: 1px dashed var(--border-muted);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.writing-item:last-child {
  border-bottom: none;
}

.writing-item:hover .writing-title {
  color: var(--text-primary);
  text-decoration: underline;
}

.writing-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.writing-meta {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Setup & Hardware Spec Grid */
.setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1.5rem;
}

.machine-spec-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.65rem 1.75rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s var(--ease-out-expo), box-shadow 0.25s var(--ease-out-expo), border-color 0.2s ease;
}

.machine-spec-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  pointer-events: none;
}

.machine-spec-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.machine-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-muted);
}

.machine-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
  letter-spacing: -0.015em;
}

.machine-role {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

.machine-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-emerald);
  padding: 0.22rem 0.6rem;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 5px;
  background: var(--accent-emerald-dim);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.spec-table {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.spec-row {
  display: grid;
  grid-template-columns: 85px 1fr;
  align-items: baseline;
  font-size: 0.92rem;
  line-height: 1.5;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-muted);
}

.spec-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.spec-row dt {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.spec-row dd {
  color: var(--text-primary);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  margin: 0;
}

.spec-sub {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 400;
  margin-left: 0.35rem;
}

/* Signals & Connect */
.connect-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.email-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
}

.email-address {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-primary);
}

.copy-button {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.copy-button:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.copy-button svg {
  width: 13px;
  height: 13px;
}

.signals-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  font-size: 0.9rem;
}

.signals-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
}

.signals-links a:hover {
  color: var(--text-primary);
}

.pgp-snippet {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-muted);
  padding-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Site Footer */
.site-footer {
  margin-top: auto;
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--border-muted);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-kbd-hint {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: none;
  padding: 0;
}

.footer-kbd-hint:hover {
  color: var(--text-primary);
}

.kbd-key {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-secondary);
}

/* Footer All-Time Views Counter */
.footer-views-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  user-select: none;
  transition: color 0.2s var(--ease-out-expo);
}

.footer-views-counter:hover {
  color: var(--text-secondary);
}

.footer-views-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.2s var(--ease-out-expo);
}

.footer-views-counter:hover .footer-views-icon {
  color: var(--text-secondary);
}

.views-counter-number {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
  transition: color 0.2s var(--ease-out-expo);
}

.footer-views-counter:hover .views-counter-number {
  color: var(--text-primary);
}

.views-counter-label {
  color: var(--text-muted);
}

/* Modal & Reader Drawers */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(9, 9, 11, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-dropdown);
  padding: 1.75rem;
  position: relative;
  transform: scale(0.97) translateY(8px);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.open .modal-card {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-muted);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.shortcuts-table {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 0.35rem 0;
}

.shortcut-desc {
  color: var(--text-secondary);
}

/* Reader View Modal */
.reader-modal {
  max-width: 660px;
  padding: 2.25rem;
}

.reader-progress {
  position: sticky;
  top: -2.25rem;
  left: -2.25rem;
  right: -2.25rem;
  height: 3px;
  background: var(--border-muted);
  margin-bottom: 1.5rem;
}

.reader-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent-emerald);
  transition: width 0.1s linear;
}

.reader-content {
  font-size: 1.18rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.reader-content p {
  margin-bottom: 1.25rem;
}

.reader-content blockquote {
  border-left: 2px solid var(--accent-emerald);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-primary);
  font-style: italic;
}

/* Ambient Audio Visualizer */
.audio-waves {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 12px;
}

.wave-bar {
  width: 2px;
  height: 100%;
  background-color: var(--text-muted);
  border-radius: 1px;
}

.audio-active .wave-bar:nth-child(1) {
  animation: wave 1.1s ease-in-out infinite alternate;
  background-color: var(--accent-emerald);
}

.audio-active .wave-bar:nth-child(2) {
  animation: wave 0.8s ease-in-out 0.2s infinite alternate;
  background-color: var(--accent-emerald);
}

.audio-active .wave-bar:nth-child(3) {
  animation: wave 1.3s ease-in-out 0.4s infinite alternate;
  background-color: var(--accent-emerald);
}

@keyframes wave {
  0% { height: 20%; }
  100% { height: 100%; }
}

/* Toast Notification */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  box-shadow: var(--shadow-dropdown);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
}

.toast-notice.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

/* Discord Profile Popout Simulation Card */
.discord-card {
  background: #111214;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.65rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  position: relative;
  user-select: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.discord-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.discord-card-banner {
  height: 105px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #1e1f22;
  image-rendering: -webkit-optimize-contrast;
  position: relative;
}

.discord-card-body {
  padding: 0 0.4rem 0.4rem;
  position: relative;
}

.discord-avatar-wrapper {
  position: relative;
  margin-top: -34px;
  margin-left: 0.4rem;
  margin-bottom: 0.65rem;
  display: inline-block;
}

.discord-avatar-frame {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 5px solid #111214;
  background: #111214;
  position: relative;
  overflow: visible;
}

.discord-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.discord-decoration-img {
  position: absolute;
  top: -12%;
  left: -12%;
  width: 124%;
  height: 124%;
  pointer-events: none;
}

.discord-status-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3.5px solid #111214;
  background-color: #80848e;
  display: flex;
  align-items: center;
  justify-content: center;
}

.discord-status-badge.status-online {
  background-color: #23a55a;
}

.discord-status-badge.status-idle {
  background-color: #f0b232;
}

.discord-status-badge.status-dnd {
  background-color: #f23f43;
}

.discord-status-badge.status-dnd::after {
  content: "";
  width: 7px;
  height: 2px;
  background: #111214;
  border-radius: 1px;
}

.discord-status-badge.status-offline {
  background-color: #80848e;
}

/* Time Difference Pill (Top Right) */
.discord-time-pill {
  position: absolute;
  top: 0.65rem;
  right: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
}

.discord-clock-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: #dbdee1;
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.discord-tz-diff {
  font-size: 0.72rem;
  color: #949ba4;
  letter-spacing: -0.01em;
}

/* Names */
.discord-names {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.65rem;
}

.discord-display-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.discord-display-name {
  color: #f2f3f5;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.discord-pronoun-badges {
  font-size: 0.75rem;
  color: #949ba4;
  font-weight: 500;
}

.discord-handle-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.discord-handle {
  color: #949ba4;
  font-size: 0.8rem;
}

.discord-device-icon {
  color: #949ba4;
  display: inline-flex;
  align-items: center;
}

/* Custom Status Bubble */
.discord-status-bubble {
  color: #dbdee1;
  font-size: 0.82rem;
  line-height: 1.4;
  padding: 0.2rem 0;
  word-break: break-word;
}

.discord-card-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 0.75rem 0;
}

/* Spotify inside Discord Card */
.discord-card-spotify {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.discord-spotify-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #1ed760;
}

.discord-spotify-content {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.discord-spotify-art-wrap {
  width: 38px;
  height: 38px;
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
}

.discord-spotify-art-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.discord-spotify-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.discord-spotify-title {
  color: #f2f3f5;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.discord-spotify-artist {
  color: #949ba4;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Watermark */
.discord-watermark-art {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  pointer-events: none;
  color: #949ba4;
  line-height: 0;
}

/* ==========================================================================
   Social Profile Popout Tabs & Instagram Simulation
   ========================================================================== */

/* Social Popout Segmented Tabs Switcher */
.social-popout-tabs {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 3px;
  margin-bottom: 0.75rem;
  gap: 4px;
}

.social-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.18s ease;
  line-height: 1;
  user-select: none;
}

.social-tab-btn:hover {
  color: var(--text-primary);
}

.social-tab-btn.is-active {
  background: var(--bg-hover);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.social-tab-btn:focus-visible {
  outline: 2px solid var(--accent-emerald);
  outline-offset: 1px;
}

/* Instagram Profile Card Simulation */
.instagram-card {
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 0.85rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  position: relative;
  user-select: none;
  transition: border-color 0.2s ease;
}

.instagram-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

/* Instagram Top Bar */
.ig-card-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
}

.ig-card-handle-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ig-card-username {
  color: #f5f5f5;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.ig-card-open-link {
  color: #a8a8a8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.ig-card-open-link:hover {
  color: #ffffff;
}

/* Header & Story Ring */
.ig-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 0.75rem;
}

.ig-story-avatar-wrap {
  flex-shrink: 0;
}

.ig-story-ring {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  padding: 2.5px;
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ig-avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #000000;
  overflow: hidden;
  background: #1a1a1a;
}

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

/* Stats Row */
.ig-stats-row {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-around;
}

.ig-stat-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}

.ig-stat-val {
  color: #f5f5f5;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.ig-stat-lbl {
  color: #a8a8a8;
  font-size: 0.72rem;
  letter-spacing: -0.01em;
}

/* Bio Section */
.ig-card-bio-section {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.8rem;
}

.ig-display-name {
  color: #f5f5f5;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.25;
}

.ig-bio-text {
  color: #dbdbdb;
  font-size: 0.78rem;
  line-height: 1.4;
  margin: 0;
}

.ig-bio-link {
  color: #3897f0;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.15s ease;
}

.ig-bio-link:hover {
  text-decoration: underline;
}

/* Action Buttons */
.ig-actions-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.ig-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity 0.15s ease, background-color 0.15s ease;
  line-height: 1.2;
}

.ig-btn-primary {
  background: #0074cc;
  color: #ffffff;
}

.ig-btn-primary:hover {
  background: #0066b2;
}

.ig-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #f5f5f5;
}

.ig-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Micro Posts Grid Kicker */
.ig-grid-kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: #a8a8a8;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.55rem;
}

/* Photo Grid */
.ig-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 0.75rem;
}

.ig-grid-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  overflow: hidden;
  background: #16181d;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.ig-grid-item.thumb-dev {
  background: linear-gradient(135deg, #18202c 0%, #0d1219 100%);
}

.ig-grid-item.thumb-design {
  background: linear-gradient(135deg, #261b2c 0%, #130d17 100%);
}

.ig-grid-item.thumb-photo {
  background: linear-gradient(135deg, #14241d 0%, #0c1410 100%);
}

.ig-grid-placeholder {
  color: rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.ig-grid-item:hover .ig-grid-placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.ig-grid-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.ig-grid-item:hover .ig-grid-overlay,
.ig-grid-item:focus-visible .ig-grid-overlay {
  opacity: 1;
}

/* Footer Link */
.ig-card-footer {
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: center;
}

.ig-footer-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #a8a8a8;
  text-decoration: none;
  transition: color 0.15s ease;
}

.ig-footer-cta:hover {
  color: #f5f5f5;
}

/* Page Arrival Keyframes */
@keyframes page-arrive {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Discord Status Badge */
.discord-status-badge.status-online {
  background-color: #23a55a;
}

/* Responsive Breakpoints & Ergonomic Layout Adaptation */
@media (max-width: 1279px) and (min-width: 960px) {
  .layout-split {
    grid-template-columns: 280px 1fr;
    gap: 3rem;
  }

  .discord-popout-col {
    grid-column: 1;
    margin-top: 1.5rem;
  }

  .discord-popout-sticky {
    position: static;
  }
}

/* Touch and Coarse Pointer Adaptation (Phones & Tablets) */
@media (pointer: coarse), (hover: none) {
  /* Hide keyboard key badges on mobile touch devices */
  .kbd-badge {
    display: none !important;
  }

  /* Expand touch target envelope to meet 44px ergonomics */
  .icon-button {
    width: 40px;
    height: 40px;
  }

  .icon-button::before {
    content: "";
    position: absolute;
    inset: -4px;
  }

  /* Prevent sticky hover styles on touch screens */
  .work-card:hover {
    transform: none !important;
    box-shadow: var(--shadow-subtle) !important;
    border-color: var(--border-subtle) !important;
  }

  .work-card:active,
  .machine-spec-card:active {
    transform: scale(0.985);
    background-color: var(--bg-surface-hover);
  }

  /* Persistent outbound link affordance */
  .work-title-link svg {
    opacity: 0.85;
  }

  .work-card:hover .work-title-link svg {
    transform: none;
  }

  /* Footer touch trigger */
  .footer-kbd-hint {
    padding: 0.5rem 0.95rem;
    min-height: 40px;
    gap: 0.35rem;
  }

  .footer-kbd-hint kbd {
    display: none;
  }
}

/* Tablet & Mobile Single-Column Collapse */
@media (max-width: 959px) {
  .layout-split {
    display: flex !important;
    flex-direction: column !important;
    gap: 2.25rem !important;
    width: 100% !important;
  }

  .discord-popout-col {
    margin-top: 2rem;
  }

  .sidebar-sticky,
  .discord-popout-sticky {
    position: static;
  }

  .page-shell {
    padding: 2rem 0 3.5rem;
  }

  .content-nav {
    position: sticky;
    top: 0;
    background: rgba(var(--bg-page-rgb), 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 25;
    padding: 0.75rem 0;
    margin: 0 -1.75rem 1.85rem;
    padding-left: 1.75rem;
    padding-right: 1.75rem;
    border-bottom: 1px solid var(--border-muted);
  }
}

/* Mobile Devices (Phones <= 640px) */
@media (max-width: 640px) {
  .container {
    padding: 0 max(1.15rem, env(safe-area-inset-left));
    padding-right: max(1.15rem, env(safe-area-inset-right));
  }

  .site-header {
    padding: max(1.35rem, env(safe-area-inset-top)) 0 1rem;
  }

  .brand {
    font-size: 0.92rem;
  }

  .header-controls {
    gap: 0.35rem;
  }

  /* Profile lockup */
  .profile-lockup {
    gap: 0.85rem;
    align-items: center;
  }

  .avatar-mark {
    width: 48px;
    height: 48px;
    font-size: 1rem;
    border-radius: 12px;
  }

  .profile-titles {
    min-width: 0;
    flex: 1;
  }

  .profile-titles h1 {
    font-size: clamp(1.2rem, 5vw, 1.38rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
  }

  .profile-sub {
    font-size: 0.8rem;
    line-height: 1.35;
  }

  .hero-bio {
    font-size: 0.92rem;
    line-height: 1.62;
  }

  /* Symmetrical 2x2 Ergonomic Thumb Grid */
  .top-contact-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    width: 100%;
  }

  .contact-chip {
    width: 100%;
    justify-content: center;
    padding: 0.55rem 0.65rem;
    font-size: 0.81rem;
    min-height: 42px;
    border-radius: 9px;
  }

  /* Centered, full-touch Segmented Navigation */
  .content-nav {
    margin: 0 -1.15rem 1.65rem;
    padding-left: 1.15rem;
    padding-right: 1.15rem;
    display: flex;
    justify-content: center;
  }

  .nav-track {
    width: 100%;
    max-width: 420px;
    display: flex;
    justify-content: space-between;
    padding: 3px;
  }

  .nav-pill {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.5rem;
    font-size: 0.82rem;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Full-width Cards & Ergonomic Paddings */
  .works-list,
  .setup-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .work-card,
  .machine-spec-card {
    padding: 1.25rem 1.15rem;
    border-radius: 11px;
  }

  .work-title-link {
    font-size: 1.02rem;
  }

  .work-desc {
    font-size: 0.89rem;
    line-height: 1.58;
  }

  .sector-header {
    margin-bottom: 1.15rem;
    padding-bottom: 0.55rem;
  }

  .sector-title {
    font-size: 1.35rem;
  }

  /* Modal on Mobile: Responsive Drawer */
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .modal-card {
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    max-height: 82vh;
    padding: 1.5rem 1.25rem max(1.75rem, env(safe-area-inset-bottom));
  }

  /* Footer Adaptation */
  .site-footer {
    padding: 2.25rem 0 max(2rem, calc(1.5rem + env(safe-area-inset-bottom)));
  }

  .footer-inner {
    flex-direction: column;
    gap: 0.85rem;
    text-align: center;
    align-items: center;
  }
}

/* Ultra-Compact Screens (<= 360px: iPhone SE, Galaxy Z Fold) */
@media (max-width: 360px) {
  .container {
    padding: 0 0.85rem;
  }

  .top-contact-bar {
    grid-template-columns: 1fr;
  }

  .avatar-mark {
    width: 44px;
    height: 44px;
  }

  .profile-titles h1 {
    font-size: 1.18rem;
  }
}

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

  .work-card:hover,
  .machine-spec-card:hover,
  .avatar-mark:hover,
  .work-card:hover .work-title-link svg,
  .icon-button:hover,
  .contact-chip:hover {
    transform: none !important;
  }
}

/* ==========================================================================
   Admin Mode & Dynamic Projects Management
   ========================================================================== */

.admin-banner {
  background: rgba(16, 185, 129, 0.08);
  border-bottom: 1px solid rgba(16, 185, 129, 0.22);
  padding: 0.45rem 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  position: sticky;
  top: 0;
  z-index: 45;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.2s ease;
}

.admin-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-banner-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.admin-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 0 2px var(--bg-surface);
  flex-shrink: 0;
}

.admin-user-tag strong {
  color: var(--accent-emerald);
  font-weight: 600;
}

.admin-divider {
  color: var(--border-subtle);
  user-select: none;
}

.admin-tip {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.admin-logout-link {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-family: var(--font-mono);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.admin-logout-link:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
}

/* Sector Header Actions & New Project Button */
.sector-header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.admin-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: var(--accent-emerald);
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.admin-new-btn:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
  transform: translateY(-1px);
}

/* Work Card Admin Controls */
.work-head-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.work-admin-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.card-admin-btn {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.card-admin-btn.btn-edit:hover {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.12);
}

.card-admin-btn.btn-delete:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.12);
}

/* Project Modal & Form */
.project-modal-card {
  max-width: 540px;
}

.project-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.project-form .form-row-2 {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.85rem;
}

.project-form .form-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.project-form .form-label .required {
  color: #ef4444;
  font-size: 0.85rem;
}

.project-form .form-sublabel {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}

.project-form .form-input,
.project-form .form-textarea {
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.62rem 0.82rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.project-form .form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.project-form .form-input:focus,
.project-form .form-textarea:focus {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.project-form .modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-muted);
}

.project-form .btn-secondary {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.52rem 1.05rem;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
}

.project-form .btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
}

.project-form .btn-primary {
  background: var(--accent-emerald);
  border: 1px solid transparent;
  color: #050608;
  font-weight: 600;
  padding: 0.52rem 1.25rem;
  border-radius: 7px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.project-form .btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.project-form .btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 640px) {
  .project-form .form-row-2 {
    grid-template-columns: 1fr;
  }
  .admin-tip {
    display: none;
  }
}

/* --- Admin Bar Quick Actions --- */
.admin-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.admin-bar-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 4px;
  padding: 0.16rem 0.55rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.15s ease;
}

.admin-bar-pill:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--accent-emerald);
}

/* --- Profile Titles & Custom Status --- */
.profile-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.inline-admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.45rem;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.22);
  color: var(--accent-emerald);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.15s ease;
}

.inline-admin-btn:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

.profile-custom-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 0.45rem;
  backdrop-filter: blur(8px);
}

.profile-custom-status .status-emoji {
  font-size: 0.85rem;
}

.status-input-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.emoji-presets {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.45rem;
  flex-wrap: wrap;
}

.emoji-chip {
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.22rem 0.48rem;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.emoji-chip:hover {
  border-color: var(--accent-emerald);
  transform: scale(1.12);
}

/* --- Socials Bar Header --- */
.contact-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  padding: 0 0.15rem;
}

.contact-bar-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* --- Notes & Devlog Sector --- */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.note-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem 1.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  transition: transform 0.25s var(--ease-out-expo), box-shadow 0.25s var(--ease-out-expo), border-color 0.2s ease;
}

.note-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.note-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.015em;
}

.note-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.note-content {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
  white-space: pre-wrap;
}

/* --- Specs Builder & Form Modals --- */
.specs-builder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
}

.specs-builder-rows {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.spec-builder-row {
  display: grid;
  grid-template-columns: 24px 110px 1fr 30px;
  gap: 0.45rem;
  align-items: center;
}

.btn-tiny {
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
}

.modal-divider {
  border: none;
  border-top: 1px solid var(--border-muted);
  margin: 1.25rem 0;
}

.modal-section-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
}

/* Socials & Sectors lists */
.socials-current-list,
.sectors-current-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 220px;
  overflow-y: auto;
}

.social-item-row,
.sector-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  font-size: 0.82rem;
}

.social-item-info,
.sector-item-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.social-item-actions,
.sector-item-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Machine Header with Admin Actions */
.machine-header-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* --- Mobile Floating Action Button & Drawer --- */
.admin-mobile-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 60;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-emerald);
  color: #050608;
  border: none;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.admin-mobile-fab:hover {
  transform: scale(1.08);
  filter: brightness(1.1);
}

.admin-mobile-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 70;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-radius: 16px 16px 0 0;
  padding: 1.25rem 1.5rem 2rem;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  transform: translateY(105%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-mobile-drawer.open {
  transform: translateY(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-muted);
}

.drawer-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mobile-drawer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

.drawer-action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.drawer-action-btn:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
}

/* Visibility rules when admin mode is active */
body.admin-mode #admin-banner { display: block !important; }
body.admin-mode #admin-edit-profile-btn { display: inline-flex !important; }
body.admin-mode #contact-bar-admin-header { display: flex !important; }
body.admin-mode #admin-manage-sectors-btn { display: inline-flex !important; }
body.admin-mode #admin-new-project-btn { display: inline-flex !important; }
body.admin-mode #admin-new-note-btn { display: inline-flex !important; }
body.admin-mode #admin-new-machine-btn { display: inline-flex !important; }
body.admin-mode .work-admin-actions { display: inline-flex !important; }

@media (max-width: 768px) {
  body.admin-mode .admin-mobile-fab { display: flex !important; }
}

/* --- Custom Confirmation Dialog Modal --- */
.confirm-modal-card {
  max-width: 400px;
  text-align: center;
  padding: 1.75rem 1.65rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.confirm-modal-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ef4444;
}

.confirm-modal-icon-wrap.info {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--accent-emerald);
}

.confirm-modal-content {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.confirm-modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.015em;
}

.confirm-modal-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.confirm-modal-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  margin-top: 0.5rem;
}

.confirm-modal-actions button {
  flex: 1;
  justify-content: center;
}

@media (max-width: 768px) {
  .confirm-modal-card {
    border-radius: 18px 18px 0 0 !important;
    padding: 1.5rem 1.25rem max(1.75rem, env(safe-area-inset-bottom)) !important;
  }
}

.btn-danger {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: transparent !important;
  font-weight: 600;
}

.btn-danger:hover {
  background: #dc2626 !important;
  filter: brightness(1.1);
}

/* --- Draggable Reordering Styles --- */
.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: color 0.15s ease, transform 0.15s ease;
  border-radius: 4px;
}

.drag-handle:hover {
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.1);
}

.drag-handle:active {
  cursor: grabbing;
}

.card-admin-btn.drag-handle {
  cursor: grab;
}

.card-admin-btn.drag-handle:active {
  cursor: grabbing;
}

.is-dragging {
  opacity: 0.38 !important;
  transform: scale(0.985) !important;
  outline: 2px dashed rgba(16, 185, 129, 0.6) !important;
  outline-offset: 2px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45) !important;
  transition: opacity 0.15s ease, transform 0.15s ease !important;
  z-index: 50 !important;
}

.social-item-row.is-dragging,
.sector-item-row.is-dragging,
.spec-builder-row.is-dragging {
  background: rgba(16, 185, 129, 0.08) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
}

/* --- Markdown Editor & Preview --- */
.editor-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.editor-mode-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.editor-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-family: var(--font-sans);
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.editor-toggle-btn:hover {
  color: var(--text-primary);
}

.editor-toggle-btn.active {
  background: var(--bg-page);
  color: var(--accent-emerald);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.note-preview-pane {
  min-height: 140px;
  max-height: 260px;
  overflow-y: auto;
  padding: 0.75rem 0.9rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.6;
}

/* --- Markdown Rendered Content Styles --- */
.markdown-rendered p.md-p {
  margin: 0 0 0.65rem 0;
  line-height: 1.6;
}
.markdown-rendered p.md-p:last-child {
  margin-bottom: 0;
}

.markdown-rendered code.inline-code {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.82em;
  color: var(--accent-emerald);
}

.markdown-rendered pre.code-block {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  margin: 0.75rem 0;
  color: #e2e8f0;
}

.markdown-rendered blockquote.md-quote {
  border-left: 3px solid var(--accent-emerald);
  padding: 0.25rem 0 0.25rem 0.85rem;
  margin: 0.75rem 0;
  color: var(--text-muted);
  font-style: italic;
  background: rgba(16, 185, 129, 0.04);
  border-radius: 0 6px 6px 0;
}

.markdown-rendered ul.md-ul,
.markdown-rendered ol.md-ol {
  margin: 0.5rem 0 0.65rem 1.25rem;
  padding: 0;
  color: var(--text-secondary);
}

.markdown-rendered li.md-li,
.markdown-rendered li.md-oli {
  margin-bottom: 0.25rem;
  line-height: 1.5;
}

.markdown-rendered a.md-link {
  color: var(--accent-emerald);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.15s ease;
}
.markdown-rendered a.md-link:hover {
  opacity: 0.8;
}

.markdown-rendered h2.md-h1,
.markdown-rendered h3.md-h2,
.markdown-rendered h4.md-h3 {
  color: var(--text-primary);
  font-weight: 600;
  margin: 1rem 0 0.5rem;
}
.markdown-rendered h2.md-h1 { font-size: 1.15rem; }
.markdown-rendered h3.md-h2 { font-size: 1rem; }
.markdown-rendered h4.md-h3 { font-size: 0.9rem; }

/* --- Inline Click-to-Edit Styles --- */
body.admin-mode [data-inline-edit] {
  cursor: pointer;
  position: relative;
  transition: all 0.18s ease;
  border-radius: 4px;
}

body.admin-mode [data-inline-edit]:hover {
  outline: 1px dashed rgba(16, 185, 129, 0.45);
  outline-offset: 2px;
  background: rgba(16, 185, 129, 0.05);
}

.inline-editing-input {
  background: var(--bg-surface) !important;
  border: 1px solid var(--accent-emerald) !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25) !important;
  color: var(--text-primary) !important;
  font-family: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  width: 100%;
  box-sizing: border-box;
  outline: none;
  resize: vertical;
}

.inline-edit-hint {
  display: block;
  font-size: 0.68rem;
  color: var(--accent-emerald);
  font-family: var(--font-mono);
  margin-top: 0.25rem;
  font-weight: 400;
}

/* --- Inline Edit Wrapper & Controls --- */
.inline-edit-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
  margin: 0.25rem 0;
  box-sizing: border-box;
}

.inline-edit-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.inline-edit-btn-save {
  background: var(--accent-emerald) !important;
  color: #052e16 !important;
  font-weight: 600 !important;
  font-size: 0.72rem !important;
  padding: 0.22rem 0.75rem !important;
  border-radius: 5px !important;
  border: none !important;
  cursor: pointer !important;
  transition: opacity 0.15s ease !important;
}

.inline-edit-btn-save:hover {
  opacity: 0.9 !important;
}

.inline-edit-btn-cancel {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-secondary) !important;
  font-size: 0.72rem !important;
  padding: 0.22rem 0.65rem !important;
  border-radius: 5px !important;
  border: 1px solid var(--border-subtle) !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.inline-edit-btn-cancel:hover {
  color: var(--text-primary) !important;
  background: rgba(255, 255, 255, 0.15) !important;
}


/* ==========================================================================
   Error Sector & 404 Recovery (whilelost.dev sanctuary)
   ========================================================================== */

.error-sector {
  display: flex;
  flex-direction: column;
}

.error-spotlight-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 2rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.error-spotlight-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-highlight), transparent);
  pointer-events: none;
}

.error-spotlight-head {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.error-radar-ring {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-emerald-dim);
  border: 1px solid rgba(16, 185, 129, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-emerald);
  position: relative;
}

.error-radar-ring::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px dashed rgba(16, 185, 129, 0.35);
  animation: radar-spin 14s linear infinite;
}

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

.error-headline-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.error-headline {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
}

.error-message {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.error-path-tag {
  display: inline-block;
  background: var(--code-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  padding: 0.15rem 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--accent-emerald);
  word-break: break-all;
}

.error-navigation-cluster {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.error-cluster-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 500;
}

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

@media (max-width: 600px) {
  .error-links-grid {
    grid-template-columns: 1fr;
  }
}

.error-dest-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1.1rem;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.2s var(--ease-out-expo);
  position: relative;
}

.error-dest-card:hover {
  background: var(--bg-elevated);
  border-color: var(--border-highlight);
  transform: translateY(-2px);
  box-shadow: var(--shadow-subtle);
}

.dest-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-emerald-dim);
  border: 1px solid rgba(16, 185, 129, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-emerald);
  flex-shrink: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

.error-dest-card:hover .dest-icon-wrap {
  transform: scale(1.05);
}

.dest-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.dest-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.dest-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dest-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s var(--ease-out-expo), color 0.2s ease;
}

.error-dest-card:hover .dest-arrow {
  color: var(--accent-emerald);
  transform: translateX(3px);
}

.error-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-muted);
  gap: 1rem;
  flex-wrap: wrap;
}

.error-quick-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.error-primary-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.88rem;
}

@media (max-width: 640px) {
  .error-spotlight-card {
    padding: 1.35rem 1.15rem;
  }
  .error-spotlight-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .error-card-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .error-primary-cta {
    justify-content: center;
  }
}

/* --- Centered 404 Experience (Fixed Zero-Scroll Viewport) --- */
html:has(body.error-page-body),
body.error-page-body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden !important;
  overscroll-behavior: none;
}

body.error-page-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

body.error-page-body .site-header {
  flex-shrink: 0;
  padding: 1.5rem 0 1rem;
}

body.error-page-body .error-page-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.25rem;
  overflow: hidden;
}

body.error-page-body .site-footer {
  flex-shrink: 0;
  padding: 1.25rem 0 1.5rem;
  margin-top: 0;
}

.error-centered-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 3rem 2.25rem 2.5rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 32px rgba(16, 185, 129, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease-out-expo), border-color 0.2s ease;
}

.error-centered-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.5), transparent);
  pointer-events: none;
}

.error-centered-card:hover {
  border-color: rgba(16, 185, 129, 0.35);
  transform: translateY(-2px);
}

.error-code-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--accent-emerald);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.error-code-badge .error-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.error-title {
  font-size: 2.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.error-desc {
  font-size: 0.96rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
  max-width: 440px;
}

.error-desc em {
  color: var(--accent-emerald);
  font-style: normal;
  font-weight: 600;
}

.error-path {
  display: inline-block;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-subtle);
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  color: var(--accent-emerald);
  font-size: 0.86em;
  word-break: break-all;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.error-action-row {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
}

.error-home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  background: var(--accent-emerald);
  color: #052e16 !important;
  transition: all 0.2s var(--ease-out-expo);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.25);
}

.error-home-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.4);
  filter: brightness(1.08);
}

.error-keyboard-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}


/* --- Simulated Code Loop Window --- */
.error-code-window {
  width: 100%;
  max-width: 440px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  text-align: left;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease;
}

[data-theme="light"] .error-code-window {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.code-window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
}

[data-theme="light"] .code-window-bar {
  background: rgba(0, 0, 0, 0.03);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.code-window-dots {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.code-window-dots .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  opacity: 0.75;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.code-window-filename {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.code-window-body {
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #e2e8f0;
}

[data-theme="light"] .code-window-body {
  color: #1e293b;
}

.code-line {
  white-space: pre-wrap;
  word-break: break-all;
}

.code-indent {
  padding-left: 1.25rem;
}

/* Syntax Token Highlighting */
.token-keyword {
  color: #f472b6;
  font-weight: 600;
}

.token-var {
  color: var(--accent-emerald);
  font-weight: 500;
}

.token-fn {
  color: #38bdf8;
}

.token-str {
  color: #34d399;
}

.token-comment {
  color: #64748b;
  font-style: italic;
}

[data-theme="light"] .token-keyword { color: #db2777; }
[data-theme="light"] .token-var { color: #059669; }
[data-theme="light"] .token-fn { color: #0284c7; }
[data-theme="light"] .token-str { color: #16a34a; }
[data-theme="light"] .token-comment { color: #94a3b8; }

/* Break Button Specifics */
.error-break-btn {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.6rem 2.2rem;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-break-symbol {
  font-size: 1.05em;
  opacity: 0.85;
}

@media (max-width: 640px) {
  body.error-page-body .site-header {
    padding: max(1rem, env(safe-area-inset-top)) 0 0.5rem;
  }
  body.error-page-body .error-page-shell {
    padding: 0.75rem 1rem;
  }
  body.error-page-body .error-centered-card {
    padding: 1.75rem 1.25rem 1.5rem;
    gap: 0.9rem;
  }
  body.error-page-body .error-title {
    font-size: 1.5rem;
  }
  body.error-page-body .error-desc {
    font-size: 0.88rem;
    line-height: 1.5;
  }
  body.error-page-body .site-footer {
    padding: 0.75rem 0 max(1rem, env(safe-area-inset-bottom));
  }
}
