/* ── style.css: Premium Ultra-Clean Design System ── */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');

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

:root {
  /* ── Instagram Brand Colors ── */
  --insta-gradient: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  --insta-blue: #0095f6;
  --insta-blue-hover: #1877f2;
  --heart-red: #ff3040;
  
  /* ── Cyberpunk OS / Grit Dark (grit.pictures style) ── */
  --bg: #070708;
  --card-bg: #121216;
  --surface: #101014;
  --surface-hover: #171720;
  --border: #1f1f26;
  --border-strong: #2e2e38;
  --border-card: 2px dashed var(--window-accent);
  --card-shadow: 0 10px 24px rgba(0,0,0,0.6);
  --text: #f0f0f5;
  --text-muted: #6b6b7f;
  --input-bg: #141419;
  --overlay-bg: rgba(5, 5, 8, 0.9);
  --modal-bg: #0c0c0f;
  --shadow: rgba(0, 0, 0, 0.7);
  --noise-opacity: 0.045;
  
  --font-primary: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', '맑은 고딕', sans-serif;
  --font-display: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', '맑은 고딕', sans-serif;
  --font-mono: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', '맑은 고딕', sans-serif;
}

[data-theme="light"] {
  /* ── Premium Light Mode (Clean & Elegant) ── */
  --bg: #e8e6f2; /* Deeper, richer premium pastel lavender (so it's elegant and cozy, not "too white") */
  --card-bg: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f3f1fa;
  --border: #e2e0ed;
  --border-strong: #bfbcd8;
  --border-card: 1.5px solid #121214;
  --card-shadow: 3px 3px 0px #121214;
  --text: #121214;
  --text-muted: #6e6b8c;
  --input-bg: #e5e5ea;
  --overlay-bg: rgba(232, 230, 242, 0.9);
  --modal-bg: #ffffff;
  --shadow: rgba(18, 18, 20, 0.05);
  --noise-opacity: 0.01;
}

/* Premium Solid White Card for profile header in light mode (contrasts beautifully with background!) */
[data-theme="light"] .profile-header {
  background-color: #ffffff;
  border-color: rgba(0, 0, 0, 0.04);
  box-shadow: 0 16px 40px rgba(110, 107, 140, 0.08), 0 1px 3px rgba(0, 0, 0, 0.01);
}

/* Premium distinct background for stats items inside the white box */
[data-theme="light"] .profile-stat {
  background-color: #f0edf6; /* Soft lavender-gray, slightly distinct from the white card background! */
  border-color: rgba(0, 0, 0, 0.04);
  box-shadow: none;
}

/* Clean highlights ring styling in light mode */
[data-theme="light"] .highlight-ring {
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .highlight-item:hover .highlight-ring {
  background: var(--insta-gradient);
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(230, 104, 60, 0.25);
}

/* ── Base & Scrollbar ── */
html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
  position: relative;
}

/* Background grid pattern removed completely to ensure extreme minimalism */
body::before {
  display: none;
}

/* Tactile Grain Noise Layer Overlay (Inspired by grit.pictures) */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: var(--noise-opacity, 0.03);
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Display helpers */
.mobile-only { display: none !important; }
.desktop-only { display: flex !important; }

/* ── App Layout ── */
.app-container {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 84px 16px 40px; /* Space for fixed top header */
  position: relative;
  z-index: 1;
}

/* ── Universal Clean Top Header ── */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: rgba(7, 7, 8, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="light"] .app-header {
  background-color: rgba(232, 230, 242, 0.75);
}

.app-header .logo {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-primary);
  user-select: none;
}

.app-header .logo::before {
  content: '■ ';
  color: var(--insta-blue);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ── CineLotto-Style Language Selector ── */
.lang-selector-wrap {
  position: relative;
}

.lang-toggle-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
  font-family: var(--font-primary);
}

.lang-toggle-btn:hover {
  background-color: var(--surface-hover);
}

.lang-menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 160px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  box-shadow: var(--card-shadow);
  z-index: 1001;
  display: none;
  overflow: hidden;
  animation: slideDown 0.15s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.lang-menu-popover.open {
  display: block;
}

#langPopoverList {
  display: flex;
  flex-direction: column;
  padding: 4px 0;
  max-height: none; /* Show all languages without scrollbars */
}

.lang-opt {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.15s, color 0.15s;
  font-family: var(--font-primary);
}

.lang-opt:hover {
  background-color: var(--surface-hover);
  color: var(--text);
}

.lang-opt.active {
  color: #39ff14; /* Lime active text like CineLotto */
  font-weight: 800;
}

.lang-opt.active::after {
  content: '●';
  font-size: 6px;
  color: #39ff14;
}

[data-theme="light"] .lang-opt.active {
  color: #bc1888;
}

[data-theme="light"] .lang-opt.active::after {
  color: #bc1888;
}

/* ── Minimalist Theme Switcher Button ── */
.theme-toggle-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s, transform 0.3s ease;
}

.theme-toggle-btn:hover {
  background-color: var(--surface-hover);
  transform: rotate(30deg);
}

/* ── Main Content Area ── */
.main-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.portfolio-container {
  width: 100%;
  animation: fadeIn 0.6s ease;
}

/* ── Compact Profile Header Area (Cyberpunk OS theme) ── */
.profile-header {
  display: grid;
  grid-template-columns: 100px 1fr;
  grid-template-areas: 
    "avatar bio"
    "avatar stats";
  column-gap: 36px;
  row-gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05); /* Softer, more premium border in dark mode */
  padding: 24px; /* Spacious, elegant padding */
  border-radius: 12px; /* Soft, modern border-radius */
  margin-bottom: 24px;
  background-color: rgba(18, 18, 22, 0.45); /* Sleeker, deeper glassmorphic charcoal */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  align-items: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35); /* Premium soft deep shadow */
}

.profile-avatar-container {
  grid-area: avatar;
  width: 80px;
  height: 80px;
  align-self: start;
  justify-self: center;
  position: relative;
  cursor: pointer;
}

.avatar-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  padding: 2px;
  background: var(--insta-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.avatar-ring::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px dashed var(--insta-blue);
  animation: spin 30s linear infinite;
  pointer-events: none;
}

.avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid var(--bg);
  background-color: var(--surface);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.avatar-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
}

.profile-stats {
  grid-area: stats;
  display: flex;
  gap: 20px;
  list-style: none;
  align-self: start;
  padding-top: 4px;
}

.profile-stat {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-primary);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 20px; /* Modern Pill-shaped badge */
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-stat:hover {
  transform: translateY(-1px);
  background-color: var(--surface-hover);
  border-color: var(--border-strong);
}

.profile-stat span {
  font-weight: 700;
  color: var(--text);
}

.stat-label {
  display: inline;
}

.profile-bio-row {
  grid-area: bio;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-title-line {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.profile-username {
  font-family: var(--font-primary);
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
}

.profile-actions {
  display: flex;
  gap: 8px;
}

.btn-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn-social svg {
  width: 15px;
  height: 15px;
}

.btn-social:hover {
  transform: translateY(-2px);
  background-color: var(--border-strong);
  color: var(--insta-blue);
  box-shadow: 0 4px 12px var(--shadow);
}

[data-theme="light"] .btn-social {
  background-color: #f0edf6;
  border-color: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .btn-social:hover {
  background-color: #e2e0ed;
  color: #bc1888;
  box-shadow: 0 4px 12px rgba(110, 107, 140, 0.15);
}

.btn-primary {
  background-color: var(--insta-blue);
  color: #ffffff;
  border: none;
  font-weight: 600;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: background-color 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--insta-blue-hover);
}

.btn-secondary {
  background-color: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: background-color 0.2s ease;
}

.btn-secondary:hover {
  background-color: var(--border);
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.btn-icon:hover {
  background-color: var(--surface-hover);
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

.profile-bio-tag {
  color: var(--text-muted);
  font-size: 11.5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.profile-bio {
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-line;
}

.profile-bio-link {
  color: var(--insta-blue);
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  align-self: start;
  font-family: var(--font-mono);
}

.profile-bio-link:hover {
  color: var(--insta-blue-hover);
  text-decoration: underline;
}

/* ── Story Highlights Bar (Compact & Centered Links Hub) ── */
.highlights-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 24px 10px 32px;
  overflow-x: auto;
  scrollbar-width: none;
}

.highlights-container::-webkit-scrollbar {
  display: none;
}

.highlight-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
  text-align: center;
  width: 80px;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.highlight-item:hover {
  transform: scale(1.1);
}

.highlight-item:hover .highlight-label {
  color: var(--text);
}

.highlight-ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 2px;
  background-color: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.highlight-item:hover .highlight-ring {
  background: var(--insta-gradient);
  box-shadow: 0 8px 20px rgba(230, 104, 60, 0.35);
}

.highlight-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--bg);
  background-color: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.highlight-item:hover .highlight-inner {
  border-color: var(--bg);
}

.highlight-inner img {
  width: 62%;
  height: 62%;
  object-fit: contain;
}

.highlight-label {
  font-size: 11px;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-family: var(--font-display);
  transition: color 0.2s ease;
}

.highlight-item:hover .highlight-label {
  color: var(--insta-blue);
}

/* ── Feed Tab Bar ── */
.feed-tabs {
  display: flex;
  justify-content: center;
  gap: 50px;
  border-bottom: 1px solid var(--border);
}

.feed-tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 10px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  position: relative;
  text-transform: uppercase;
  font-family: var(--font-display);
  transition: color 0.2s;
}

.feed-tab-btn::after {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1.5px;
  background-color: transparent;
  transition: background-color 0.2s;
}

.feed-tab-btn.active {
  color: var(--text);
}

.feed-tab-btn.active::after {
  background-color: var(--text);
}

.feed-tab-btn svg {
  width: 11px;
  height: 11px;
}

/* ── PC/Mobile Feed Grid ── */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
  justify-content: center;
}

/* ── HIGH FIDELITY RETRO OS WINDOW CARDS (Inspired by 109ichiki.com & grit.pictures) ── */
.feed-card.retro-window {
  aspect-ratio: 1 / 1;
  background-color: var(--card-bg);
  border: var(--border-card);
  border-radius: 4px;
  position: relative;
  overflow: visible; /* Allows tape marker to stick out */
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.22s, box-shadow 0.22s;
  display: flex;
  flex-direction: column;
  max-width: 172px;
  width: 100%;
  justify-self: center;
  box-shadow: var(--card-shadow);
}

.feed-card.retro-window:hover {
  transform: translateY(-4px) scale(1.02);
}

[data-theme="dark"] .feed-card.retro-window:hover {
  box-shadow: 0 12px 28px rgba(0,0,0,0.7), 0 0 16px rgba(var(--window-accent-rgb, 0), 0.25);
  border-style: solid; /* Dynamic shift to solid outline on hover */
}

[data-theme="light"] .feed-card.retro-window:hover {
  box-shadow: 5px 5px 0px #000000;
}

/* Tape Marker for Dark Mode collage style */
.feed-card.retro-window .tape-marker {
  display: none;
}

[data-theme="dark"] .feed-card.retro-window .tape-marker {
  display: block;
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  width: 55px;
  height: 15px;
  background-color: rgba(230, 220, 200, 0.25); /* Translucent washi tape look */
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  border-left: 1px dashed rgba(255,255,255,0.25);
  border-right: 1px dashed rgba(255,255,255,0.25);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  z-index: 10;
}

[data-theme="dark"] .feed-card.retro-window::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 4px;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.05), transparent 40%);
  z-index: 4;
}

/* Maps color strings to their glows */
.feed-card.retro-window[style*="--window-accent: #00f0ff"] { --window-accent-rgb: 0, 240, 255; }
.feed-card.retro-window[style*="--window-accent: #39ff14"] { --window-accent-rgb: 57, 255, 20; }
.feed-card.retro-window[style*="--window-accent: #d600ff"] { --window-accent-rgb: 214, 0, 255; }
.feed-card.retro-window[style*="--window-accent: #ffb000"] { --window-accent-rgb: 255, 176, 0; }
.feed-card.retro-window[style*="--window-accent: #0052ff"] { --window-accent-rgb: 0, 82, 255; }

/* ── Window Title Bar ── */
.window-header {
  height: 22px;
  background-color: rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  flex-shrink: 0;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="light"] .window-header {
  background-color: #ded9f2; /* Beautiful lavender title bar */
  border-bottom: 1.5px solid #000000;
}

[data-theme="dark"] .window-header {
  background-color: #0b0b0e;
  border-bottom: 1px dashed var(--border-strong);
}

.window-dot-wrap {
  display: flex;
  gap: 4px;
}

.window-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  opacity: 0.85;
}

[data-theme="light"] .window-dot {
  border: 1px solid #000000;
}

.window-dot.red { background-color: #ff5f56; }
.window-dot.yellow { background-color: #ffbd2e; }
.window-dot.green { background-color: #27c93f; }

.window-title {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
  transition: color 0.3s ease;
}

[data-theme="light"] .window-title {
  color: #000000;
}

/* ── Window Body (artwork & grids) ── */
.window-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.02);
  transition: background-color 0.2s;
}

[data-theme="light"] .window-body {
  background-color: #ffffff;
}

[data-theme="dark"] .window-body {
  background-color: #08080a;
}

/* Custom mathematical wave grid background overlay */
.window-art-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(var(--window-accent) 0.5px, transparent 0.5px),
    linear-gradient(90deg, var(--window-accent) 0.5px, transparent 0.5px);
  background-size: 8px 8px;
  opacity: 0.06;
  transition: opacity 0.25s ease;
  z-index: 1;
}

[data-theme="light"] .window-art-grid {
  opacity: 0.05;
  background-size: 10px 10px;
}

[data-theme="dark"] .window-art-grid {
  opacity: 0.07;
  background-size: 8px 8px;
}

.feed-card.retro-window:hover .window-art-grid {
  opacity: 0.16;
}

/* Hand-drawn sketch decorations behind the logo in dark mode */
.sketch-svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  color: var(--window-accent);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease, filter 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

[data-theme="dark"] .sketch-svg {
  opacity: 0.18;
}

.feed-card.retro-window:hover .sketch-svg {
  transform: translate(-50%, -50%) scale(1.15) rotate(6deg);
}

[data-theme="dark"] .feed-card.retro-window:hover .sketch-svg {
  opacity: 0.38;
  filter: drop-shadow(0 0 6px var(--window-accent));
}

.window-body-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 10px;
}

.window-app-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.3s;
}

[data-theme="light"] .window-app-icon {
  background: #f7f6fc;
  border: 1px solid #000000;
  box-shadow: 1.5px 1.5px 0px #000000;
}

.feed-card.retro-window:hover .window-app-icon {
  transform: scale(1.15) rotate(5deg);
  border-color: var(--window-accent);
}

[data-theme="light"] .feed-card.retro-window:hover .window-app-icon {
  border-color: #000000;
  box-shadow: 2.5px 2.5px 0px #000000;
}

.window-app-icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
  transition: filter 0.3s ease;
}

[data-theme="dark"] .window-app-icon img {
  filter: drop-shadow(0 0 4px var(--window-accent));
}

.window-app-name {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.2px;
  transition: color 0.2s;
  text-transform: uppercase;
}

[data-theme="light"] .window-app-name {
  color: #000000;
}

/* ── Window Footer Status ── */
.window-footer {
  height: 18px;
  background-color: rgba(0, 0, 0, 0.05);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  color: var(--text-muted);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="light"] .window-footer {
  background-color: #ded9f2;
  border-top: 1.5px solid #000000;
  color: #000000;
}

[data-theme="dark"] .window-footer {
  background-color: #0b0b0e;
  border-top: 1px dashed var(--border-strong);
}

.window-status-text {
  color: var(--window-accent);
  font-weight: 800;
  letter-spacing: 0.5px;
}

[data-theme="light"] .window-status-text {
  color: #000000;
}

.window-domain-link {
  text-transform: lowercase;
  opacity: 0.8;
}

/* Post Stats Overlay (Instagram Engagement hover effect) */
.card-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  z-index: 3;
  transition: opacity 0.2s ease;
}

.feed-card:hover .card-overlay {
  opacity: 1;
}

.card-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #ffffff;
  font-weight: 700;
  font-size: 12px;
  font-family: var(--font-display);
  transform: translateY(6px);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.feed-card:hover .card-stat {
  transform: translateY(0);
}

.card-stat svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* ── Footer ── */
.portfolio-footer {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 10.5px;
}

.portfolio-footer a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.portfolio-footer a:hover {
  color: var(--insta-blue);
}

/* ── Fullscreen Post Detail Modal (Instagram Web post view) ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--overlay-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  animation: fadeIn 0.25s ease;
}

.modal-overlay.open {
  display: flex;
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  z-index: 2010;
  padding: 8px;
  border-radius: 50%;
  transition: background-color 0.2s, transform 0.2s;
}

.modal-close-btn:hover {
  background-color: rgba(255,255,255,0.15);
  transform: rotate(90deg);
}

.modal-close-btn svg {
  width: 28px;
  height: 28px;
}

/* Modal OS style pop-up window */
.post-modal-card {
  width: 100%;
  max-width: 860px;
  height: 100%;
  max-height: 560px;
  background-color: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: 4px; /* Sharp corners */
  overflow: hidden;
  display: flex;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--border);
  animation: scaleUp 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
}

/* Left panel of modal: Visual Mockup CRT Terminal */
.modal-visual-pane {
  flex: 1.1;
  background-color: #030305;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--border);
}

/* Cyberpunk terminal wave grid & scanning lines */
.modal-visual-bg {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(var(--window-accent) 0.5px, transparent 0.5px),
    linear-gradient(90deg, var(--window-accent) 0.5px, transparent 0.5px);
  background-size: 12px 12px;
  opacity: 0.08;
  z-index: 0;
  filter: saturate(1.5);
  transform: scale(1.1);
}

/* Retro CRT phosphor scanning scanline effect */
.modal-visual-pane::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.04), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.04));
  background-size: 100% 4px, 6px 100%;
  pointer-events: none;
  z-index: 2;
}

.modal-visual-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--window-accent); /* Green/Cyan phosphor color */
  text-shadow: 0 0 6px var(--window-accent);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  height: 100%;
}

.modal-visual-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1.5px solid var(--window-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px var(--window-accent);
  animation: pulse 3s ease-in-out infinite;
}

.modal-visual-icon img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px var(--window-accent));
}

.modal-visual-title {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.modal-visual-subtitle {
  font-size: 12.5px;
  color: var(--text);
  text-shadow: none;
  font-family: var(--font-mono);
  letter-spacing: 0.8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border);
  padding: 3px 12px;
  border-radius: 4px;
}

/* Right panel of modal: Instagram Feed Detail */
.modal-detail-pane {
  flex: 0.9;
  display: flex;
  flex-direction: column;
  background-color: var(--modal-bg);
}

/* Header */
.post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background-color: rgba(255,255,255,0.01);
}

.post-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.post-header-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  padding: 1.5px;
  background: var(--insta-gradient);
}

.post-header-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1.5px solid var(--modal-bg);
  object-fit: cover;
  object-position: center 15%;
}

.post-header-info {
  display: flex;
  flex-direction: column;
}

.post-header-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono);
}

.post-header-location {
  font-size: 10.5px;
  color: var(--text-muted);
}

.post-header-sponsored {
  font-weight: 600;
  color: var(--insta-blue);
  font-size: 11.5px;
  font-family: var(--font-mono);
}

/* Comments Area (Caption + User Comments) */
.post-comments-area {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.comment-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  background-color: var(--surface-hover);
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-body {
  font-size: 12.5px;
  line-height: 1.45;
}

.comment-user {
  font-weight: 700;
  margin-right: 6px;
  color: var(--text);
  font-family: var(--font-mono);
}

.comment-text {
  color: var(--text);
  white-space: pre-line;
}

.comment-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.tag-item {
  color: var(--insta-blue);
  font-size: 12px;
  text-decoration: none;
  font-weight: 500;
  font-family: var(--font-mono);
}

.tag-item:hover {
  text-decoration: underline;
}

/* Post Actions */
.post-actions-bar {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-buttons {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.action-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.action-btn {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, transform 0.1s;
}

.action-btn:hover {
  color: var(--text-muted);
}

.action-btn:active {
  transform: scale(0.9);
}

.action-btn svg {
  width: 20px;
  height: 20px;
}

.action-btn.liked {
  color: var(--heart-red);
  animation: heartPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.action-btn.bookmarked {
  color: var(--text);
}

.action-btn.liked svg {
  fill: currentColor;
}

.action-btn.bookmarked svg {
  fill: currentColor;
}

/* Launch App Button in Modal */
.btn-launch-app {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background-color: var(--insta-blue);
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s, transform 0.1s;
  box-shadow: 0 4px 10px rgba(0, 149, 246, 0.2);
  font-family: var(--font-mono);
}

.btn-launch-app:hover {
  background-color: var(--insta-blue-hover);
}

.btn-launch-app:active {
  transform: scale(0.98);
}

.post-stats-footer {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.post-stats-date {
  font-size: 9.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 3px;
  letter-spacing: 0.5px;
  font-family: var(--font-mono);
}

/* Comment Input Area */
.post-comment-input-wrap {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border);
  padding: 6px 14px;
}

.post-comment-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  padding: 6px 0;
  resize: none;
  outline: none;
  font-family: var(--font-primary);
  max-height: 80px;
}

.post-comment-submit {
  background: none;
  border: none;
  color: var(--insta-blue);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  padding: 6px;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.post-comment-submit.active {
  opacity: 1;
}

/* ── Fullscreen Story Viewer ── */
.story-overlay {
  position: fixed;
  inset: 0;
  background-color: #0f0f10;
  z-index: 2500;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.story-overlay.open {
  display: flex;
}

.story-container {
  width: 100%;
  max-width: 400px;
  height: 100%;
  max-height: 70vh;
  position: relative;
  background-color: var(--surface);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
}

.story-progress-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  height: 3px;
  display: flex;
  gap: 4px;
  z-index: 10;
}

.story-progress-track {
  flex: 1;
  background-color: rgba(255, 255, 255, 0.35);
  height: 100%;
  border-radius: 2px;
  overflow: hidden;
}

.story-progress-fill {
  width: 0%;
  height: 100%;
  background-color: #ffffff;
  transition: width linear;
}

.story-header {
  position: absolute;
  top: 20px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  color: #ffffff;
}

.story-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.story-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
  overflow: hidden;
}

.story-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
}

.story-author {
  font-weight: 700;
  font-size: 13px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  font-family: var(--font-mono);
}

.story-close {
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 6px;
}

.story-close svg {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.story-content-pane {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--story-gradient, linear-gradient(135deg, #cc2366, #ff3040));
  color: #ffffff;
}

.story-content-box {
  text-align: center;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  z-index: 1;
}

.story-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 1.5px solid rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.story-icon-wrap img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.story-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  text-shadow: 0 3px 8px rgba(0,0,0,0.25);
}

.story-desc {
  font-size: 13.5px;
  line-height: 1.5;
  text-shadow: 0 2px 5px rgba(0,0,0,0.25);
}

.story-swipe-up {
  position: absolute;
  bottom: 30px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #ffffff;
  text-decoration: none;
  animation: bounce 2s infinite;
  z-index: 10;
}

.story-swipe-up svg {
  width: 18px;
  height: 18px;
}

.story-swipe-text {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: rgba(255,255,255,0.22);
  padding: 5px 14px;
  border-radius: 20px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Navigation inside stories */
.story-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.2s;
}

.story-container:hover .story-nav-btn {
  opacity: 1;
}

.story-nav-btn:hover {
  background: rgba(255,255,255,0.3);
}

.story-nav-left { left: 10px; }
.story-nav-right { right: 10px; }

/* ── Toast Notification ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: var(--modal-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 6px 24px var(--shadow);
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
  font-family: var(--font-mono);
}

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

.toast-icon {
  color: var(--insta-blue);
}

/* ── Keyframe Animations ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

@keyframes heartPop {
  0% { transform: scale(1); }
  35% { transform: scale(1.25); }
  65% { transform: scale(0.92); }
  100% { transform: scale(1); }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
  60% { transform: translateY(-3px); }
}

/* ── Responsive Styling (Desktop / Tablet / Mobile) ── */

@media (max-width: 600px) {
  .app-container {
    padding: 76px 12px 24px;
  }

  .app-header {
    height: 52px;
    padding: 0 16px;
  }

  .app-header .logo {
    font-size: 14px;
  }

  .lang-toggle-btn {
    font-size: 12px;
    padding: 4px 8px;
  }

  /* Compact Mobile Profile Layout (Avatar + Stats Side-by-Side) */
  .profile-header {
    display: grid;
    grid-template-columns: 60px 1fr;
    grid-template-areas: 
      "avatar bio"
      "avatar stats";
    column-gap: 16px;
    row-gap: 6px;
    padding: 16px;
    margin-bottom: 8px;
    align-items: center;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: rgba(16, 16, 20, 0.2);
  }
  
  .profile-avatar-container {
    grid-area: avatar;
    width: 60px;
    height: 60px;
    margin: 0;
  }
  
  .avatar-ring::after {
    inset: -3px;
    border-width: 1px;
  }

  .avatar-inner {
    border-width: 2px;
  }
  
  .profile-stats {
    grid-area: stats;
    display: flex;
    gap: 8px;
    list-style: none;
    align-self: start;
    padding-top: 2px;
  }
  
  .profile-bio-row {
    grid-area: bio;
    width: 100%;
    gap: 2px;
    margin-top: 2px;
  }
  
  .profile-title-line {
    margin-bottom: 1px;
  }
  
  .profile-username {
    font-size: 14px;
    font-weight: 700;
  }

  .highlights-container {
    justify-content: center;
    gap: 14px;
    padding: 16px 8px 24px;
    margin-bottom: 0px;
    border-bottom: none;
  }
  
  .highlight-item {
    width: 64px;
    gap: 4px;
  }
  
  .highlight-ring {
    width: 56px;
    height: 56px;
    padding: 1.5px;
  }
  
  .highlight-inner {
    border-width: 2px;
  }
  
  .highlight-label {
    font-size: 10px;
    font-weight: 600;
  }
}
