/* ═══════════════════════════════════════════════════════════
   CUSTOM PROPERTIES
═══════════════════════════════════════════════════════════ */
:root {
  /* Surfaces */
  --sidebar-bg:   #f9fafb;
  --content-bg:   #ffffff;
  --card-bg:      #f9fafb;

  /* Borders */
  --border:       #e5e7eb;
  --border-hover: #d1d5db;

  /* Accent */
  --accent:       #2563eb;
  --accent-hover: #1d4ed8;
  --accent-bg:    rgba(37, 99, 235, 0.08);
  --accent-ring:  rgba(37, 99, 235, 0.2);

  /* Status colors */
  --green:        #15803d;
  --green-bg:     rgba(21, 128, 61, 0.08);
  --green-ring:   rgba(21, 128, 61, 0.22);
  --amber:        #92400e;
  --amber-bg:     rgba(146, 64, 14, 0.08);
  --amber-ring:   rgba(146, 64, 14, 0.22);
  --violet:       #6d28d9;
  --violet-bg:    rgba(109, 40, 217, 0.08);
  --violet-ring:  rgba(109, 40, 217, 0.2);

  /* Text – high contrast */
  --text:         #111827;   /* gray-900 */
  --text-body:    #1f2937;   /* gray-800 */
  --text-muted:   #4b5563;   /* gray-600 */
  --text-dim:     #9ca3af;   /* gray-400 */

  /* Fonts */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* Layout */
  --sidebar-w: 280px;
  --mobile-h:   56px;

  /* Radius */
  --r:    8px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Shadows */
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.05);
  --shadow:     0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:  0 8px 24px rgba(0,0,0,0.1),  0 2px 6px rgba(0,0,0,0.05);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t:    all 0.2s var(--ease);
}


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

html { font-size: 16px; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--content-bg);
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }


/* ═══════════════════════════════════════════════════════════
   APP SHELL
═══════════════════════════════════════════════════════════ */
.app {
  display: flex;
  height: 100dvh;
  overflow: hidden;
}


/* ═══════════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

/* ── Profile ─────────────────────────────── */
.profile {
  padding: 32px 24px 28px;
  border-bottom: 1px solid var(--border);
}

/* Avatar container – works for both img and initials */
.avatar-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--border);
  margin-bottom: 16px;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}
.avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.avatar-initials {
  width: 100%;
  height: 100%;
  background: var(--accent);
  color: #fff;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.05em;
}

.profile-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.profile-role {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 6px;
  min-height: 1.5em;
  display: flex;
  align-items: center;
  gap: 1px;
}
.typed-cursor {
  display: inline-block;
  width: 1.5px;
  height: 0.85em;
  background: var(--accent);
  border-radius: 1px;
  animation: blink 1s step-end infinite;
  flex-shrink: 0;
}
.profile-location {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ── Navigation ──────────────────────────── */
.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--r);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.925rem;
  font-weight: 500;
  transition: var(--t);
  text-align: left;
  position: relative;
}
.nav-label { flex: 1; }
.nav-icon {
  font-size: 0.85rem;
  flex-shrink: 0;
  opacity: 0.5;
  width: 18px;
  text-align: center;
  transition: opacity 0.2s;
}
.nav-badge {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  background: rgba(0,0,0,0.06);
  padding: 2px 7px;
  border-radius: 100px;
}

.nav-item:hover {
  background: rgba(0,0,0,0.04);
  color: var(--text);
}
.nav-item:hover .nav-icon { opacity: 0.7; }

.nav-item.active {
  background: var(--accent-bg);
  color: var(--accent);
}
.nav-item.active .nav-icon { opacity: 1; }
.nav-item.active .nav-badge { color: var(--accent); background: var(--accent-bg); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 22%; bottom: 22%;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

/* ── Social footer ───────────────────────── */
.sidebar-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
}
.social-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--content-bg);
  color: var(--text-muted);
  font-size: 1rem;
  transition: var(--t);
  box-shadow: var(--shadow-sm);
}
.social-btn:hover {
  border-color: var(--accent-ring);
  color: var(--accent);
  background: var(--accent-bg);
  box-shadow: var(--shadow);
}


/* ═══════════════════════════════════════════════════════════
   CONTENT AREA
═══════════════════════════════════════════════════════════ */
.content {
  flex: 1;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}


/* ═══════════════════════════════════════════════════════════
   PANELS
═══════════════════════════════════════════════════════════ */
.panel {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  opacity: 0;
  pointer-events: none;
  transform: translateX(20px);
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease);
}
.panel.active {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.panel::-webkit-scrollbar       { width: 5px; }
.panel::-webkit-scrollbar-track { background: transparent; }
.panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* ── Panel header (sticky) ───────────────── */
.panel-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 48px;
}
.panel-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.panel-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
}
.panel-sub {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 3px;
}

/* ── Panel body ──────────────────────────── */
.panel-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 48px 72px;
}


/* ═══════════════════════════════════════════════════════════
   ABOUT PANEL – PROFILE HERO
═══════════════════════════════════════════════════════════ */
.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 0 52px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 52px;
}

.hero-avatar-wrap {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #fff;
  box-shadow: 0 0 0 1px var(--border), 0 12px 40px rgba(0,0,0,0.12);
  margin-bottom: 24px;
  flex-shrink: 0;
}
.hero-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.hero-avatar-initials {
  width: 100%;
  height: 100%;
  background: var(--accent);
  color: #fff;
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-name {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.04em;
  margin-bottom: 10px;
}
.hero-role {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 8px;
  min-height: 1.6em;
}
.hero-location {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.hero-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--r);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--accent);
  transition: var(--t);
}
.hero-btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.hero-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  background: var(--content-bg);
  color: var(--text-muted);
  border-radius: var(--r);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--t);
}
.hero-btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* ── Bio & interests ─────────────────────── */
.bio-text {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-body);
  margin-bottom: 20px;
  max-width: 680px;
}
.bio-extra {
  margin-bottom: 48px;
}

.block-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.825rem;
  font-weight: 500;
  cursor: default;
  user-select: none;
  transition: var(--t);
  border: 1px solid transparent;
}
.tag:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tag.systems      { background: var(--accent-bg);  color: var(--accent);  border-color: var(--accent-ring);  }
.tag.algorithms   { background: var(--violet-bg);  color: var(--violet);  border-color: var(--violet-ring);  }
.tag.applications { background: var(--green-bg);   color: var(--green);   border-color: var(--green-ring);   }


/* ═══════════════════════════════════════════════════════════
   PUBLICATIONS PANEL
═══════════════════════════════════════════════════════════ */
.pub-filters {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 5px 14px;
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 0.73rem;
  border: 1px solid var(--border);
  background: var(--content-bg);
  color: var(--text-muted);
  transition: var(--t);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
}

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pub-card {
  background: var(--content-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow);
  transition: var(--t);
  position: relative;
  overflow: hidden;
}
.pub-card::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.pub-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.pub-card:hover::after { opacity: 1; }
.pub-card.hidden { display: none; }

.pub-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.status-badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.status-badge.accepted         { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green-ring); }
.status-badge.under-submission { background: var(--amber-bg);  color: var(--amber);  border: 1px solid var(--amber-ring); }
.status-badge.preprint         { background: var(--violet-bg); color: var(--violet); border: 1px solid var(--violet-ring); }

.pub-chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 5px;
  background: rgba(0,0,0,0.04);
  border: 1px solid var(--border);
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

.pub-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 7px;
}
.pub-authors {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.pub-venue {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
}

.pub-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.pub-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: var(--r);
  font-size: 0.8rem;
  font-family: var(--mono);
  border: 1px solid var(--border);
  background: var(--content-bg);
  color: var(--text-muted);
  transition: var(--t);
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.pub-btn:hover  { border-color: var(--accent);  color: var(--accent);  background: var(--accent-bg); box-shadow: none; }
.pub-btn.active { border-color: var(--accent);  color: var(--accent);  background: var(--accent-bg); box-shadow: none; }
.pub-btn.copied { border-color: var(--green);   color: var(--green);   background: var(--green-bg);  box-shadow: none; }

.pub-abstract {
  display: none;
  margin-top: 16px;
  padding: 18px 20px;
  border-radius: var(--r);
  background: var(--card-bg);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-body);
  line-height: 1.85;
  animation: fadeIn 0.2s var(--ease);
}
.pub-abstract.open { display: block; }


/* ═══════════════════════════════════════════════════════════
   EXPERIENCE PANEL
═══════════════════════════════════════════════════════════ */
.timeline {
  position: relative;
  padding-left: 24px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 3px; top: 14px; bottom: 14px;
  width: 1px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  padding-bottom: 52px;
  padding-left: 32px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -5px; top: 8px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--content-bg);
  border: 2.5px solid var(--accent);
  box-shadow: 0 0 0 3px var(--content-bg);
}
.timeline-type {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}
.timeline-title  { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.timeline-org    { font-size: 0.925rem; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }
.timeline-period {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.timeline-desc {
  font-size: 0.95rem;
  color: var(--text-body);
  line-height: 1.8;
  margin-bottom: 16px;
  max-width: 620px;
}
.timeline-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.timeline-tag {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 500;
}


/* ═══════════════════════════════════════════════════════════
   CONTACT PANEL
═══════════════════════════════════════════════════════════ */
.contact-wrap {
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.contact-headline {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.contact-body {
  font-size: 1rem;
  color: var(--text-body);
  line-height: 1.85;
  max-width: 520px;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  background: var(--content-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  transition: var(--t);
}
.contact-card:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.contact-card:hover .contact-card-icon  { color: var(--accent); }
.contact-card:hover .contact-card-label { color: var(--accent); }
.contact-card-icon  { font-size: 1.3rem; flex-shrink: 0; color: var(--text-muted); }
.contact-card-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  transition: color 0.2s;
}
.contact-card-desc  {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--mono);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ═══════════════════════════════════════════════════════════
   LIFE PANEL
═══════════════════════════════════════════════════════════ */

/* ── "Right Now" strip ───────────────────── */
.now-strip {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 36px;
  background: var(--content-bg);
  box-shadow: var(--shadow-sm);
}
.now-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  flex: 1;
  min-width: 0;
  border-right: 1px solid var(--border);
  transition: background 0.2s;
}
.now-item:last-child { border-right: none; }
.now-item:hover { background: var(--card-bg); }
.now-emoji { font-size: 1.25rem; flex-shrink: 0; line-height: 1; }
.now-meta  { min-width: 0; }
.now-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 3px;
}
.now-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Section label divider ───────────────── */
.life-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.life-section-head::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.life-section-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  font-weight: 600;
  flex-shrink: 0;
}

/* ── Interest chips ──────────────────────── */
.hobbies-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
}
.interest-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--content-bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  transition: var(--t);
  cursor: default;
}
.interest-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* ── Filter bar ──────────────────────────── */
.life-filters {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

/* ── Photo board (cork-board background) ─── */
.photo-board {
  background: #cdc8c0;
  border-radius: 12px;
  padding: 32px 20px 20px;
}

/* ── Polaroid photo grid ─────────────────── */
.photo-wall {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 36px 16px;
}

/* Each polaroid card */
.photo-item {
  position: relative;
  background: #fffef8;
  padding: 10px 10px 0;
  box-shadow: 4px 6px 18px rgba(0,0,0,0.30), 0 2px 4px rgba(0,0,0,0.14);
  cursor: zoom-in;
  transform: rotate(var(--rot, 0deg));
  transition: transform 0.25s ease, box-shadow 0.25s ease, z-index 0s;
  z-index: 1;
  /* ensure tape shows above board but item still flows in grid */
  isolation: isolate;
}

/* Washi tape */
.photo-item::after {
  content: '';
  display: block;
  position: absolute;
  top: -14px;
  left: 50%;
  width: 52px;
  height: 22px;
  background: var(--tape-color, rgba(255, 228, 120, 0.85));
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.20);
  transform: translateX(-50%) rotate(var(--tape-rot, 0deg));
  pointer-events: none;
}

/* Tape color variants */
.photo-item:nth-child(5n+1) { --tape-color: rgba(255, 225, 100, 0.88); --tape-rot:  2deg;  --rot: -3.5deg; }
.photo-item:nth-child(5n+2) { --tape-color: rgba(150, 210, 255, 0.88); --tape-rot: -3deg;  --rot:  2.8deg; }
.photo-item:nth-child(5n+3) { --tape-color: rgba(195, 240, 170, 0.88); --tape-rot:  4deg;  --rot: -1.6deg; }
.photo-item:nth-child(5n+4) { --tape-color: rgba(255, 180, 180, 0.88); --tape-rot: -1deg;  --rot:  4.0deg; }
.photo-item:nth-child(5n+5) { --tape-color: rgba(215, 195, 255, 0.88); --tape-rot:  2deg;  --rot: -2.5deg; }

.photo-item:hover {
  transform: rotate(0deg) translateY(-8px) scale(1.06) !important;
  box-shadow: 6px 16px 40px rgba(0,0,0,0.36), 0 4px 8px rgba(0,0,0,0.16);
  z-index: 20;
}

/* Image inside polaroid */
.polaroid-img-wrap {
  overflow: hidden;
  line-height: 0;
  background: #eee;
}
.polaroid-img-wrap img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
  transition: filter 0.25s ease;
}
.photo-item:hover .polaroid-img-wrap img {
  filter: saturate(1.12) brightness(1.04);
}

/* Caption strip below image */
.polaroid-footer {
  padding: 9px 6px 11px;
  text-align: center;
}
.polaroid-caption {
  display: block;
  font-size: 0.78rem;
  color: #3a3530;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.polaroid-tag {
  display: block;
  font-family: var(--mono);
  font-size: 0.58rem;
  color: #9a9088;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  margin-top: 2px;
}

.photo-item.hidden { display: none; }

.photo-empty {
  text-align: center;
  padding: 40px 0;
  color: #9a9088;
  font-size: 0.88rem;
}

/* ── Lightbox ────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--r);
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  font-size: 1.8rem;
  color: rgba(255,255,255,0.7);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}
.lightbox-close:hover { color: #fff; }
.lightbox-info {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
}
.lightbox-caption {
  font-size: 1rem;
  color: rgba(255,255,255,0.95);
  font-weight: 600;
  margin-bottom: 6px;
}
.lightbox-desc {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.72);
  line-height: 1.55;
  max-width: 520px;
  margin: 0 auto 10px;
}
.lightbox-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}
.lb-meta-item {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: rgba(255,255,255,0.48);
  letter-spacing: 0.04em;
}
.lb-tag {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
}


/* ═══════════════════════════════════════════════════════════
   MOBILE HEADER
═══════════════════════════════════════════════════════════ */
.mobile-header {
  display: none;
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--mobile-h);
  z-index: 200;
  background: rgba(249,250,251,0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}
.mobile-logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: var(--t);
}
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-drawer {
  display: none;
  position: fixed;
  inset: var(--mobile-h) auto 0 0;
  width: 290px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  z-index: 190;
  padding: 20px 0;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.28s var(--ease);
  box-shadow: var(--shadow-lg);
}
.mobile-drawer.open { transform: none; }

.drawer-backdrop {
  display: none;
  position: fixed;
  inset: var(--mobile-h) 0 0 0;
  background: rgba(17,24,39,0.25);
  z-index: 180;
  opacity: 0;
  transition: opacity 0.28s var(--ease);
}
.drawer-backdrop.open { opacity: 1; }

.mobile-profile {
  padding: 4px 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
#mobile-nav { padding: 4px 12px; }
.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  margin-bottom: 2px;
  border-radius: var(--r);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--t);
  text-align: left;
}
.mobile-nav-item:hover  { background: rgba(0,0,0,0.04); color: var(--text); }
.mobile-nav-item.active { background: var(--accent-bg);  color: var(--accent); }


/* ═══════════════════════════════════════════════════════════
   KEYFRAMES
═══════════════════════════════════════════════════════════ */
@keyframes blink  { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }


/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .panel-header { padding: 0 28px; }
  .panel-body   { padding: 40px 28px 60px; }
}

@media (max-width: 768px) {
  .sidebar      { display: none; }
  .mobile-header { display: flex; }
  .mobile-drawer { display: block; }
  .drawer-backdrop { display: block; }
  .app { height: calc(100dvh - var(--mobile-h)); margin-top: var(--mobile-h); }
  .panel-header { padding: 0 20px; }
  .panel-body   { padding: 32px 20px 56px; }
}

@media (max-width: 1100px) {
  .photo-wall  { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .photo-wall  { grid-template-columns: repeat(2, 1fr); gap: 32px 14px; }
  .photo-board { padding: 32px 16px 16px; }
  .now-strip   { flex-wrap: wrap; }
  .now-item    { flex: 1 1 45%; border-bottom: 1px solid var(--border); }
  .now-item:nth-child(even) { border-right: none; }
}

@media (max-width: 480px) {
  .pub-card    { padding: 18px 18px; }
  .contact-grid { grid-template-columns: 1fr; }
  .photo-wall  { grid-template-columns: 1fr; gap: 28px 0; }
  .photo-board { padding: 28px 12px 12px; }
  .now-item    { flex: 1 1 100%; border-right: none; }
}
