/* Apple hint styles - terminal contact style */
.apple-logo-hint {
  color: var(--syntax-entity-tag) !important;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
  font-weight: bold;
}

.apple-logo-hint:hover {
  color: #2563eb; /* Hover color like terminal links */
  text-decoration: none;
}

/* Стиль для анимации тряски логотипа в стиле Apple */
.apple-hint-highlight {
  animation: apple-shake 0.6s cubic-bezier(.36,.07,.19,.97) both;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Анимация тряски в стиле Apple */
@keyframes apple-shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-4px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(4px);
  }
}

/* Apple logo box styles */
.apple-logo-box {
  border: 2px solid #ff5e8f;
  background: #1a1017;
  color: #ff5e8f;
  border-radius: 10px;
  box-shadow: 0 2px 16px #1a001a;
  margin-bottom: 2em;
  padding: 15px 20px;
  display: block;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

.apple-logo-box strong {
  color: white !important;
  font-weight: bold;
}

.apple-logo-box a {
  color: #3b82f6;
  text-decoration: none;
}

.apple-logo-box a:hover {
  text-decoration: underline;
}

/* Стили для вложенной навигации */
.subsection-container {
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
  overflow: hidden;
}

.subsection-container.hidden {
  display: none;
}

.subsection-item {
  margin-left: 0.25rem;
  border-left: 1px solid rgba(107, 114, 128, 0.3);
  transition: all 0.2s ease;
  position: relative;
}

.subsection-item:hover {
  border-left-color: rgba(107, 114, 128, 0.7);
}

.subsection-item.active-subsection-item {
  background-color: rgba(59, 130, 246, 0.15);
  color: #fff;
  border-left-color: #ff5e8f;
}

.subsection-item.active-subsection-item span {
  background-color: #ff5e8f;
}

.sidebar-item.active-sidebar-item {
  background-color: #3A3A3A;
  color: white;
}

/* Стиль для подсветки найденного элемента */
.highlight-element {
  animation: pulse-highlight 1.5s ease-in-out;
  scroll-margin-top: 20px;
}

@keyframes pulse-highlight {
  0% { background-color: transparent; }
  30% { background-color: rgba(249, 38, 114, 0.2); }
  70% { background-color: rgba(249, 38, 114, 0.2); }
  100% { background-color: transparent; }
}

/* Markdown content —  macOS/terminal style */
.custom-window-content.markdown-content {
  background: transparent;
  color: #ececec;
  line-height: 1.7;
  font-size: 0.875rem;
  padding: 0 1.5rem;
}

.custom-window-content.markdown-content > *:first-child {
  margin-top: 0.9rem;
}

.custom-window-content.markdown-content h1,
.custom-window-content.markdown-content h2,
.custom-window-content.markdown-content h3,
.custom-window-content.markdown-content h4 {
  font-weight: 600;
  margin-top: 2.1em;
  margin-bottom: 0.7em;
  line-height: 1.25;
}
.custom-window-content.markdown-content h1 {
  font-size: 2rem;
  border-bottom: 2px solid #323232;
  padding-bottom: 0.2em;
  margin-bottom: 1em;
  color: var(--syntax-keyword);
}
.custom-window-content.markdown-content h2 {
  font-size: 1.45rem;
  border-left: 4px solid #ff5e8f;
  padding-left: 0.6em;
  background: rgba(255, 94, 143,0.07);
  color: wheat;
  margin-top: 2em;
  margin-bottom: 1em;
}
.custom-window-content.markdown-content h3 {
  font-size: 1.18rem;
  border-left: 3px solid #ff5e8f;
  padding-left: 0.5em;
  color: wheat;
  margin-top: 1.5em;
  margin-bottom: 0.7em;
  border-radius: 0 0.3em 0.3em 0;
}
.custom-window-content.markdown-content h4 {
  font-size: 1.05rem;
  color: var(--syntax-keyword);
  margin-top: 1.2em;
  margin-bottom: 0.5em;
}

.custom-window-content.markdown-content p {
  margin: 0 0 1.1em 0;
  color: #ececec;
}

.custom-window-content.markdown-content strong {
  color: #ff5e8f;
  font-weight: 600;
}

.custom-window-content.markdown-content ul,
.custom-window-content.markdown-content ol {
  margin: 0 0 1.2em 1.5em;
  padding: 0;
}
.custom-window-content.markdown-content ul li,
.custom-window-content.markdown-content ol li {
  margin-bottom: 0.4em;
  padding-left: 0.2em;
}
.custom-window-content.markdown-content ul li::marker {
  color: var(--syntax-operator-char);
  font-size: 1.1em;
}
.custom-window-content.markdown-content ol li::marker {
  color: var(--syntax-operator-char);
}

.custom-window-content.markdown-content blockquote {
  margin: 1.5em 0;
  padding: 0.9em 1.3em;
  background: rgba(59,130,246,0.10);
  border-left: 4px solid #3b82f6;
  color: #b6cdfa;
  font-style: italic;
  border-radius: 0 0.5em 0.5em 0;
}

.custom-window-content.markdown-content pre {
  background: #181c22;
  color: #d7ffb7;
  padding: 1em 1.2em;
  border-radius: 0.5em;
  margin: 1.2em 0;
  overflow-x: auto;
  border: 1px solid #22272e;
}
.custom-window-content.markdown-content code {
  background: #23272e;
  color: #b7f7ff;
  padding: 0.15em 0.45em;
  border-radius: 0.3em;
  font-size: 0.97em;
}
.custom-window-content.markdown-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: 1em;
}

.custom-window-content.markdown-content hr {
  border: none;
  border-top: 1px solid #323232;
  margin: 2em 0;
}

.custom-window-content.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  background: #181c22;
  border-radius: 0.4em;
  overflow: hidden;
}
.custom-window-content.markdown-content th,
.custom-window-content.markdown-content td {
  border: 1px solid #23272e;
  padding: 0.6em 1em;
  text-align: left;
}
.custom-window-content.markdown-content th {
  background: #23272e;
  color: #b7f7ff;
}
.custom-window-content.markdown-content tr:nth-child(even) td {
  background: #20232b;
}

.custom-window-content.markdown-content a {
  color: #3b82f6;
  text-decoration: underline;
  transition: color 0.15s;
}
.custom-window-content.markdown-content a:hover {
  color: #60a5fa;
  text-decoration: underline;
}

.custom-window-content.markdown-content img {
  max-width: 100%;
  border-radius: 0.4em;
  margin: 1em 0;
  box-shadow: 0 2px 16px rgba(0,0,0,0.15);
}

/* Base Styles */

.terminal-contacts {
  background: #181c1f;
  color: #00ff41;
  font-family: 'Fira Mono', 'Consolas', monospace;
  padding: 16px 24px;
  border-radius: 8px;
  margin-bottom: 1.5em;
  box-shadow: 0 2px 16px #000a;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1rem;
}
.terminal-contacts .terminal-contact-value {
  font-weight: bold;
  /* No color here, let a, span etc. decide! */
}
.terminal-contacts a.terminal-contact-value {
  color: var(--syntax-entity-tag);
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}
.terminal-contacts a.terminal-contact-value:hover {
  color: var(--syntax-function-name);
}
.terminal-contacts .terminal-contact-value:not(a) {
  color: #fff;
}
.terminal-contacts a {
  color: var(--syntax-entity-tag);
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}
.terminal-contacts a:hover {
  color: var(--syntax-function-name);
}

.terminal-contacts .prompt {
  color: #39ff14;
  margin-right: 0.5em;
}
.terminal-contacts-flex {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}
.terminal-contacts-pre {
  font-family: 'Fira Mono', 'Consolas', 'Menlo', monospace;
  font-size: 16px;
  margin: 0;
  padding: 0;
  line-height: 20px;
  background: none;
  border: none;
  box-shadow: none;
  display: block;
}
.terminal-photo-img {
  width: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #ff5e8f;
  margin-left: 16px;
  display: block;
  background: none;
  padding: 0;
  box-sizing: border-box;
}
.terminal-contacts.variant1 {
  border-color: #00ff41;
  box-shadow: 0 2px 16px #000a;
}
.terminal-contacts.variant2 {
  border-color: #39a9ff;
  background: #101a28;
  color: #39a9ff;
  box-shadow: 0 2px 16px #001a;
}
.terminal-contacts.variant2 .prompt {
  color: #39a9ff;
}
.terminal-contacts.variant2 .terminal-block {
  color: #b6e6ff;
}
.terminal-contacts.variant3 {
  /* background: transparent; */
  border: 2px solid #ff5e8f;
  background: #1a1017;
  color: #ff5e8f;
  border-radius: 10px;
  box-shadow: 0 2px 16px #1a001a;
  margin-bottom: 2em;
  display: block;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}
.terminal-contacts-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 24px 6px 12px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  flex-wrap: wrap;
}
.terminal-contacts-flex pre {
  /* background: transparent; */
  min-width: 0;
  flex: 1 1 220px;
  word-break: break-all;
  box-sizing: border-box;
}
.terminal-photo-wrapper {
  display: flex;
  align-items: center;
  height: 100%;
  padding-right: 0;
  box-sizing: border-box;
  min-width: 0;
  width: auto;
}
@media (max-width: 600px) {
  .terminal-contacts-flex pre {
    flex: none !important;
  }

  .terminal-contacts-flex pre {
    max-width: 320px;
    margin: 0 auto;
    display: block;
    height: auto !important;
    min-height: unset !important;
  }

  .terminal-contacts-flex {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 10px 8px;
  }
  .terminal-photo-wrapper {
    justify-content: center;
    margin-top: 12px;
    padding: 0 12px;
    width: 100%;
    box-sizing: border-box;
  }
  .terminal-photo-img {
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
  }
}


.terminal-photo-wrapper {
  display: flex;
  align-items: center;
  height: 100%;
  padding-right: 12px;
  box-sizing: border-box;
}
.terminal-photo-img {
  max-width: 100%;
  height: auto;
  max-height: 180px;
  border: 2px solid #ff5e8f;
  border-radius: 8px;
  box-sizing: border-box;
}
.terminal-photo-img {
  align-self: center;
  max-height: 100%;
}
.terminal-contacts.variant3 pre {
  background: transparent;
  color: #ff5e8f;
  font-family: inherit;
  font-size: 1em;
  margin: 0;
  padding: 0;
  border: none;
}


:root {
    --terminal-bg: #1E1E1E; /* Default dark background for terminal */
    --terminal-text: #E0E0E0; /* Default text color in terminal */
    
    /* macOS UI Elements */
    --menu-bar-bg: rgba(26, 26, 26, 0.8); /* Semi-transparent menu bar */
    --window-header-bg: rgba(48, 48, 48, 0.9); /* Terminal window header */
    --focus-ring-color: rgba(86, 155, 229, 0.6);

    /* Syntax Highlighting Colors (Monokai-inspired) */
    --syntax-text-default: #F8F8F2;  /* General text (white) */
    --syntax-comment: #75715E;       /* Comments (greyish green) */
    --syntax-keyword: #ff5e8f;       /* Keywords, tags (pink) */
    --syntax-function-name: #A6E22E; /* Function names, class names, main titles (green) */
    --syntax-string-value: #E6DB74;  /* String literals, values (yellow) */
    --syntax-variable-name: #FD971F; /* Variables, attributes (orange) */
    --syntax-entity-tag: #66D9EF;    /* Entities, types, secondary titles (cyan) */
    --syntax-operator-char: #ff5e8f; /* Operators, prompt chars (pink) */
    
    --syntax-prompt-user: var(--syntax-function-name); /* Green for user in prompt */
    --syntax-prompt-path: var(--syntax-entity-tag);    /* Cyan for path in prompt */
    --syntax-prompt-special: var(--syntax-operator-char); /* Pink for $ or > in prompt */
    
    --syntax-output-dim: #909090;      /* Dimmed or less important output */
    --syntax-error: #F44747;         /* Errors */

    /* macOS Desktop Background Gradient (Sonoma/Ventura inspired) */
    --macos-bg-gradient: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
}

body {
    background-image: var(--macos-bg-gradient);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--terminal-text); /* Fallback, should be overridden by specific elements */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden; 
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Accessibility: Hide content visually but not for screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.matrix-canvas-overlay {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.38s;
    width: 100%;
    height: 100%;
}

/* Menu Bar */
.menu-bar {
    background-color: var(--menu-bar-bg);
    backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px);
    height: 28px; 
    flex-shrink: 0;
    /* Tailwind classes used: h-7 flex items-center justify-between px-4 text-sm z-10 relative */
    color: var(--syntax-keyword); /* pink accent for menu items */
    -webkit-user-select: none;
    user-select: none;
    box-shadow: 0 1px 0 rgba(0,0,0,0.2);
}

.menu-bar #clock {
    color: #fff;
}
body.light-theme .menu-bar #clock {
    color: #23272e;
}

.left-menu, .center-menu, .right-menu {
    display: flex;
    align-items: center;
}

.left-menu {
    /* Добавляем отступ справа от меню с логотипом Apple */
    margin-right: auto;
}

.center-menu {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: #AAAAAA; 
    font-weight: 500;
}

.apple-logo { /* Button for cursor icon */
    /* Tailwind: cursor-pointer p-1 rounded hover:bg-white/10 focus:bg-white/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 */
    height: 100%; /* Ensure it fills menu bar height for click area if p-1 is small */
    margin-right: 16px; /* Стандартный отступ справа от логотипа Apple, как в macOS */
}

/* Адаптивные отступы для разных размеров экрана */
@media (max-width: 768px) {
    .apple-logo {
        margin-right: 12px; /* Уменьшенный отступ для планшетов */
    }
}

@media (max-width: 480px) {
    .apple-logo {
        margin-right: 8px; /* Еще меньший отступ для мобильных устройств */
    }
}

.apple-logo svg {
    /* Tailwind: w-4 h-4 text-gray-200 */
    filter: brightness(1.5); /* Make cursor slightly brighter */
}
/* Remove ::before if SVG is directly in HTML now */
.apple-logo::before {
    content: none;
}

/* Profile Photo Popup */
#profile-popup {
    z-index: 100; 
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}
#profile-popup:not(.hidden) { opacity: 1; pointer-events: auto; }

.profile-popup-content {
    background-color: rgba(35, 35, 35, 0.97);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}
#profile-popup:not(.hidden) .profile-popup-content { transform: scale(1); }

/* Light theme for body: macOS Sequoia/Sonoma style */
body.light-theme {
    background-image: linear-gradient(to right top, #845ec2, #a55dbd, #c15db5, #d95fab, #ec64a0, #f76e91, #fd7b84, #ff8a7a, #ffa26e, #ffbd66, #ffda65, #f9f871);
    color: #23272e;
    transition: background 0.7s cubic-bezier(.4,0,.2,1), color 0.3s, background-image 0.7s cubic-bezier(.4,0,.2,1);
}

/* Стиль для терминала в светлой теме */
body.light-theme .terminal-window {
    background-color: rgba(250, 250, 250, 0.85) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.15) !important;
}

/* Для светлой темы: неактивная кнопка языка как часы в меню */
body.light-theme .language-toggle button[aria-selected="false"] {
    color: #23272e !important;
    border-color: #23272e !important;
    background: transparent !important;
}
body.light-theme .language-toggle button[aria-selected="false"]:hover {
    background-color: rgba(35,39,46,0.07) !important;
    color: #23272e !important;
    border-color: #23272e !important;
}
body.light-theme .language-toggle button[aria-selected="true"] {
    background-color: #007AFF !important;
    color: #fff !important;
    border-color: #007AFF !important;
}

/* --- Светлая тема для терминала --- */
body.light-theme .terminal-window {
    background-color: rgba(255,255,255,0.92) !important;
    border: 1px solid #e6eaf1 !important;
    box-shadow: 0 8px 25px rgba(170,180,200,0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
body.light-theme .terminal-header {
    background-color: rgba(245,247,250,0.98) !important;
    border-bottom: 1px solid #e6eaf1 !important;
    color: #23272e !important;
}
body.light-theme .window-controls > div {
    border: 0.5px solid #e6eaf1;
}
body.light-theme .terminal-title {
    color: #23272e !important;
}
body.light-theme .terminal-content {
    background: transparent !important;
    color: #23272e !important;
    --syntax-text-default: #23272e;
    --syntax-comment: #7b7e87;
    --syntax-keyword: #6029c9;
    --syntax-function-name: #007a5a;
    --syntax-string-value: #b8860b;
    --syntax-variable-name: #c2410c;
    --syntax-entity-tag: #2563eb;
    --syntax-operator-char: #b91c1c;
    --syntax-prompt-user: #007a5a;
    --syntax-prompt-path: #2563eb;
    --syntax-prompt-special: #b91c1c;
    --syntax-output-dim: #9ca3af;
    --syntax-error: #e11d48;
}
body.light-theme .terminal-content::-webkit-scrollbar {
    width: 10px;
}
body.light-theme .terminal-content::-webkit-scrollbar-track {
    background: #f3f6fa;
}
body.light-theme .terminal-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 5px;
    border: 2px solid #f3f6fa;
}
body.light-theme .terminal-content::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}
body.light-theme .terminal-initial-prompt {
    color: #9ca3af !important;
}
body.light-theme .resume-output .syntax-prompt-user {
    color: #007a5a !important;
}
body.light-theme .resume-output .syntax-prompt-path {
    color: #2563eb !important;
}
body.light-theme .resume-output .syntax-prompt-dollar,
body.light-theme .resume-output .syntax-prompt-arrow {
    color: #6029c9 !important;
}
body.light-theme .resume-output .syntax-command-main {
    color: #007a5a !important;
    border-bottom: 1px solid #e6eaf1 !important;
}
body.light-theme .resume-output .syntax-command-section {
    color: #2563eb !important;
}
body.light-theme .resume-output .syntax-command-subsection {
    color: #c2410c !important;
}
body.light-theme .resume-output .syntax-general-output,
body.light-theme .resume-output ul,
body.light-theme .resume-output ul li {
    color: #23272e !important;
}
body.light-theme .resume-output ul li::before {
    color: #6029c9 !important;
}
body.light-theme .resume-output .syntax-key {
    color: #6029c9 !important;
}
body.light-theme .resume-output .syntax-value {
    color: #b8860b !important;
}
body.light-theme .resume-output .syntax-value-contact {
    color: #2563eb !important;
}
body.light-theme .resume-output .syntax-tech {
    color: #6029c9 !important;
}
body.light-theme .resume-output .syntax-job-title {
    color: #007a5a !important;
}
body.light-theme .resume-output .syntax-job-date {
    color: #7b7e87 !important;
}
body.light-theme .resume-output .syntax-achievement-marker {
    color: #7b7e87 !important;
}
body.light-theme .resume-output .syntax-achievement-text {
    color: #23272e !important;
}
body.light-theme .resume-output .syntax-philosophy-item {
    color: #b8860b !important;
}
body.light-theme .resume-output strong {
    color: #6029c9 !important;
}
body.light-theme .resume-output em {
    color: #7b7e87 !important;
}
body.light-theme .resume-output a {
    color: #2563eb !important;
}
body.light-theme .resume-output a:hover {
    color: #007a5a !important;
}
body.light-theme .syntax-cat-command {
    color: #9ca3af !important;
}
body.light-theme .terminal-loader {
    color: #6029c9 !important;
}
body.light-theme .terminal-photo-img {
    border-color: #6029c9 !important;
}
body.light-theme .terminal-contacts {
    background: #f3f6fa !important;
    color: #007a5a !important;
    border-color: #6029c9 !important;
}

body.light-theme .apple-logo-box {
    background: #f3f6fa !important;
    color: black !important;
    border-color: #6029c9 !important;
    box-shadow: 0 2px 16px rgba(96, 41, 201, 0.2) !important;
}
body.light-theme .terminal-contacts .prompt {
    color: #007a5a !important;
}
body.light-theme .terminal-contacts a.terminal-contact-value {
    color: #2563eb !important;
}
body.light-theme .terminal-contacts a:hover {
    color: #6029c9 !important;
}
body.light-theme .terminal-contacts .terminal-contact-value {
    color: #007a5a !important;
}
body.light-theme .terminal-contacts.variant2 {
    background: #e0e7ef !important;
    color: #2563eb !important;
    border-color: #6029c9 !important;
}
body.light-theme .terminal-contacts.variant2 .prompt {
    color: #2563eb !important;
}
body.light-theme .terminal-contacts.variant2 .terminal-block {
    color: #007a5a !important;
}
body.light-theme .terminal-contacts.variant3 pre {
    color: #6029c9 !important;
}
body.light-theme .terminal-contacts-flex {
    background: transparent !important;
}

/* Стили для Apple меню в светлой теме */
body.light-theme #profile-popup {
    background-color: rgba(240, 240, 240, 0.85);
}

body.light-theme .profile-popup-content {
    background-color: rgba(250, 250, 250, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

body.light-theme .macos-window-header {
    background-color: #f5f5f7;
    border-bottom: 1px solid #e5e5e5;
}

body.light-theme #profile-popup-title {
    color: #333;
}

/* Боковая панель в светлой теме */
body.light-theme #profile-popup .w-full.md\:w-64 {
    background-color: rgba(250, 250, 250, 0.85);
    background-image: linear-gradient(to right top, rgba(132, 94, 194, 0.1), rgba(165, 93, 189, 0.1), rgba(193, 93, 181, 0.1), rgba(217, 95, 171, 0.1), rgba(236, 100, 160, 0.1));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-right: 1px solid rgba(224, 224, 224, 0.7);
}

body.light-theme .sidebar-item {
    color: #444;
}

body.light-theme .sidebar-item:hover {
    background-color: rgba(106, 49, 214, 0.1);
}

body.light-theme .sidebar-item.active-sidebar-item {
    background-color: rgba(106, 49, 214, 0.2);
    color: #6029c9;
}

body.light-theme .sidebar-item svg {
    color: #777;
}

/* Подразделы в светлой теме */
body.light-theme .subsection-item {
    color: #555;
    border-left-color: rgba(106, 49, 214, 0.3);
}

body.light-theme .subsection-item:hover {
    border-left-color: rgba(106, 49, 214, 0.6);
    background-color: rgba(106, 49, 214, 0.05);
}

body.light-theme .subsection-item.active-subsection-item {
    background-color: rgba(106, 49, 214, 0.15);
    color: #6029c9;
    border-left-color: #6029c9;
}

body.light-theme .subsection-item.active-subsection-item span {
    background-color: #6029c9;
    color: white;
}

/* Основная область контента */
body.light-theme #profile-popup-main {
    background: linear-gradient(to right top, #f8f2fa, #fffbf3) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}

body.light-theme #profile-popup-loader {
    color: #6029c9;
}

/* Цвета Markdown контента */
body.light-theme .custom-window-content.markdown-content {
    color: #333;
    background: transparent;
}

body.light-theme .custom-window-content.markdown-content h2 {
    border-left: 4px solid #6029c9;
    background: rgba(106, 49, 214, 0.07);
    color: #333;
}

body.light-theme .custom-window-content.markdown-content h3 {
    border-left: 3px solid #6029c9;
    color: #333;
}

body.light-theme .custom-window-content.markdown-content p {
    color: #444;
}

body.light-theme .custom-window-content.markdown-content strong {
    color: #6029c9;
    font-weight: 600;
}

/* Стиль для pulse-highlight в светлой теме */
body.light-theme .highlight-element {
    animation: pulse-highlight-light 1.5s ease-in-out;
    scroll-margin-top: 20px;
}

@keyframes pulse-highlight-light {
    0% { background-color: transparent; }
    30% { background-color: rgba(96, 41, 201, 0.2); }
    70% { background-color: rgba(96, 41, 201, 0.2); }
    100% { background-color: transparent; }
}


/* Light theme for menu bar: airy, blurred, semi-transparent */
.menu-bar-light {
    background: rgba(255,255,255,0.72) !important;
    color: #23272e !important;
    backdrop-filter: blur(16px) saturate(180%);
    box-shadow: 0 2px 12px 0 rgba(30,34,40,0.07);
    border-bottom: 1px solid #e6eaf1;
    transition: background 0.4s cubic-bezier(.4,0,.2,1), color 0.3s;
}

.menu-bar-light .apple-logo svg,
.menu-bar-light .right-menu img,
.menu-bar-light .right-menu svg,
.menu-bar-light .center-menu {
    color: #23272e !important;
    filter: none !important;
}

.menu-bar-light #theme-icon {
    filter: none !important;
}

/* Smooth transition for theme toggle */
.menu-bar, .menu-bar-light, body, body.light-theme {
    transition: background 0.5s cubic-bezier(.4,0,.2,1), color 0.3s;
}

/* macOS Style Buttons */
.macos-button {
    border: 0.5px solid rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.macos-button:hover::before {
    opacity: 1;
}

.macos-button::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.close-button::before {
    content: '\00D7'; /* Символ X */
    font-size: 9px;
    color: rgba(0, 0, 0, 0.5);
    font-weight: bold;
}

.minimize-button::before {
    content: '';
    width: 8px;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.5);
}

/* Закругленные углы для элементов в профиле */
.sidebar-item {
    border-radius: 8px;
}

.active-sidebar-item {
    background-color: rgba(58, 58, 58, 0.8);
}

/* Закругление всех панелей в профиле */
.bg-\[\#2A2A2A\] {
    border-radius: 10px;
}

/* Стили для заголовка */
.macos-window-header {
    border-bottom-color: rgba(60, 60, 60, 0.6);
}


/* Desktop Area */
main {
    background-color: transparent; /* Show body background */
    flex-grow: 1; 
    display: flex;
    align-items: center; 
    justify-content: center; 
    overflow: hidden; 
    /* Tailwind: p-4 relative */
}

/* Terminal Window */
.terminal-window {
    background-color: rgba(30, 30, 30, 0.85); /* var(--terminal-bg) with alpha */
    backdrop-filter: blur(10px); /* Stronger blur for terminal body */
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,0.3);
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    /* Tailwind: w-full max-w-5xl rounded-lg shadow-xl overflow-hidden flex flex-col */
    height: calc(100vh - 28px - 40px); /* menubar - main padding (p-4 = 1rem = 16px * 2 = 32px, but also consider parent padding) */
    max-height: 850px; 
}

.terminal-header {
    background-color: var(--window-header-bg);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    /* Tailwind: h-8 flex items-center px-3 relative */
    flex-shrink: 0;
    border-top-left-radius: 9px;
    border-top-right-radius: 9px;
    border-bottom: 1px solid rgba(0,0,0,0.2);
    -webkit-user-select: none;
    user-select: none;
}

.window-controls > div { width: 12px; height: 12px; border-radius: 50%; border: 0.5px solid rgba(0,0,0,0.2); }
.window-controls > div:nth-child(1) { background-color: #FF5F56; } /* Red */
.window-controls > div:nth-child(2) { background-color: #FFBD2E; } /* Yellow */
.window-controls > div:nth-child(3) { background-color: #27C93F; } /* Green */

.terminal-title { /* Tailwind: mx-auto text-sm text-gray-400 */
     position: absolute; 
     left: 50%;
     transform: translateX(-50%);
     color: #AAAAAA;
     font-weight: 500;
     white-space: nowrap; 
     overflow: hidden;
     text-overflow: ellipsis; 
     max-width: calc(100% - 180px); /* Adjust based on controls and lang toggle width */
}

/* Language Toggle - Moved to Header */
.language-toggle {
    position: absolute;
    right: 12px; /* Position to the right in the header */
    top: 50%;
    transform: translateY(-50%);
    z-index: 5; /* Below title if overlapping, but should not */
    display: flex;
    gap: 5px;
}
.language-toggle button {
    padding: 3px 7px; /* Smaller for header */
    border-radius: 5px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent; 
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    -webkit-user-select: none;
    user-select: none;
}
/* Удаляем анимацию увеличения кнопок */
/* .language-toggle button:hover { transform: translateY(-50%) scale(1.05); } */
/* .language-toggle button:active { transform: translateY(-50%) scale(1); } */

.language-toggle button:focus { outline: none; }
.language-toggle button:focus-visible { box-shadow: 0 0 0 2px var(--focus-ring-color); }

.language-toggle button[aria-selected="true"] {
    background-color: #007AFF; /* macOS Blue */
    color: white;
    border-color: #007AFF;
}
.language-toggle button[aria-selected="false"] {
    /* background: transparent; */
    color: #DEDEDE;
    border-color: rgba(100, 100, 100, 0.5);
}
.language-toggle button[aria-selected="false"]:hover {
     background-color: rgba(90, 90, 90, 0.8); 
     border-color: rgba(120, 120, 120, 0.6);
}

/* Terminal Content Area */
.terminal-content {
    /* Tailwind: p-4 overflow-y-auto flex-1 font-mono text-sm */
    color: var(--syntax-text-default); /* Base text color for content */
    line-height: 1.7;
    white-space: pre-wrap; 
    word-wrap: break-word; 
    outline: none; /* For tabindex */
    animation: fadeInTerminalContent 0.5s 0.2s ease-out backwards;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: subpixel-antialiased;
    padding: 1rem;
    overflow-y: auto;
    flex: 1 1 0%;
    font-family: 'Fira Mono', 'Consolas', 'Menlo', 'Monaco', 'Liberation Mono', monospace;
    font-size: 0.875rem;
    background: none;
    border: none;
}


@keyframes fadeInTerminalContent {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.terminal-content:focus-visible { box-shadow: inset 0 0 0 2px var(--focus-ring-color); }

/* Scrollbar Styling for Terminal */
.terminal-content::-webkit-scrollbar { width: 10px; }
.terminal-content::-webkit-scrollbar-track { background: var(--terminal-bg); }
.terminal-content::-webkit-scrollbar-thumb { background: #4A4A4A; border-radius: 5px; border: 2px solid var(--terminal-bg); }
.terminal-content::-webkit-scrollbar-thumb:hover { background: #5A5A5A; }

/* Custom window content styles (night theme by default) */
.custom-window-content {
    background: var(--window-bg, #222);
    color: var(--window-text, #eee);
    overflow-y: auto;
    border-radius: 10px;
    padding: 1rem;
    font-family: 'Fira Mono', 'Consolas', monospace;
    font-size: 0.95rem;
}
.custom-window-content::-webkit-scrollbar {
    width: 10px;
}
.custom-window-content::-webkit-scrollbar-track {
    background: var(--window-bg, #222);
}
.custom-window-content::-webkit-scrollbar-thumb {
    background: #4A4A4A;
    border-radius: 5px;
    border: 2px solid var(--window-bg, #222);
}
.custom-window-content::-webkit-scrollbar-thumb:hover {
    background: #5A5A5A;
}

/* Light theme for custom window content */
body.light-theme .custom-window-content {
    background: #f3f6fa;
    color: #23272e;
}
body.light-theme .custom-window-content::-webkit-scrollbar-track {
    background: #f3f6fa;
}
body.light-theme .custom-window-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border: 2px solid #f3f6fa;
}
body.light-theme .custom-window-content::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}


/* Initial Terminal Prompt Line (hardcoded in HTML) */
.terminal-initial-prompt { /* Tailwind: mb-2 text-gray-400 */
    color: var(--syntax-output-dim); /* Use a dimmer color for the static prompt */
}
.terminal-initial-prompt .syntax-prompt-user,
.terminal-initial-prompt .syntax-prompt-path,
.terminal-initial-prompt .syntax-prompt-char,
.terminal-initial-prompt .syntax-text-default {
    display: inline; /* Ensure they stay on one line if wrapped in spans by script, though this is HTML */
}

/* Syntax Highlighting Styles for dynamically loaded content */
#theme-toggle {
    position: relative;
    overflow: hidden;
}

#theme-toggle,
#theme-toggle:hover,
#theme-toggle:focus,
#theme-toggle:active {
    background: none !important;
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

#theme-icon {
    transition: transform 0.5s cubic-bezier(.4,0,.2,1), color 0.7s cubic-bezier(.4,0,.2,1);
    color: #ffc207;
}

#theme-icon.theme-dark-purple {
    color: #5e5cde;
}



#theme-toggle.animated #theme-icon {
    transform: rotate(180deg) scale(1.2);
}

#resume-content {
    position: relative;
 /* Container for parsed markdown */
    /* Base text color set by .terminal-content */
}

/* Убираем лишний отступ у параграфов, которые появляются из-за пустых строк в markdown */
.resume-output p {
    margin: 0 !important;
    padding: 0 !important;
}

.resume-output > div {
    margin: 0 !important;
    padding: 0 !important;
}


/* Комплексное решение для отступов в терминале */
.terminal-content {
    display: flex;
    flex-direction: column;
}

/* Сбрасываем все маржины и паддинги */
.resume-output {
    margin: 0 !important;
    padding-top: 1.5rem !important;
    padding-bottom: 1rem !important;
}

/* Первый элемент внутри терминала */
.resume-output > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
.syntax-cat-command {
    margin-top: 0 !important;
    padding-top: 0 !important;
}



.resume-output .syntax-command-main,
.resume-output .syntax-command-section,
.resume-output .syntax-command-subsection {
    margin-top: 0.2rem;
    margin-bottom: 0.2rem; /* Было 0.6rem, стало компактнее */
    display: block;
}

/* Убираем верхний отступ у первого элемента после заголовка */
.resume-output .syntax-command-main + *,
.resume-output .syntax-command-section + *,
.resume-output .syntax-command-subsection + * {
    margin-top: 0 !important;
}

.resume-output .syntax-general-output {
    margin-top: 0.2rem;
    margin-bottom: 0.6rem;
    display: block;
}

/* Уменьшаем верхний отступ у ul после секций */
.resume-output ul {
    margin-top: 0.2rem !important;
    margin-bottom: 0.8rem;
}

.resume-output .syntax-prompt-user { color: var(--syntax-prompt-user); }
.resume-output .syntax-prompt-path { color: var(--syntax-prompt-path); }
.resume-output .syntax-prompt-dollar,
.resume-output .syntax-prompt-arrow { color: var(--syntax-prompt-special); }
.resume-output .syntax-command-text { color: var(--syntax-text-default); font-weight: 500; }


.resume-output .syntax-command-main { /* For H1 */
    font-size: 1.3em;
    color: var(--syntax-function-name); /* Green, like a major command */
    border-bottom: 1px solid rgba(128,128,128,0.3);
    padding-bottom: 0.3em;
    margin-top: 0.2em; /* Less top margin for the very first command */
}

.resume-output .syntax-command-section { /* For H2 */
    font-size: 1.2em;
    color: var(--syntax-entity-tag); /* Cyan, like a section */
}

.resume-output .syntax-command-subsection { /* For H3 */
    font-size: 1.1em;
    color: var(--syntax-variable-name); /* Orange, like a sub-section or detail */
}

.resume-output .syntax-general-output { /* For P tags */
    color: var(--syntax-text-default);
    margin-left: 1.5rem; /* Indent regular output under prompts */
}

.resume-output ul {
    list-style-type: none; 
    padding-left: 0; /* Remove default padding, handled by li */
    margin-bottom: 1rem;
    margin-left: 1.5rem; /* Indent lists like output */
}

.resume-output ul li {
    position: relative; 
    margin-bottom: 0.15rem !important;
    padding-left: 1.2rem; /* Space for custom bullet */
    color: var(--syntax-text-default);
    line-height: 1.4 !important;
}
.resume-output ul li * {
    line-height: 1.4 !important;
}

.resume-output ul li strong,
.resume-output ul li strong * {
    font-size: 1.07em;
}

.resume-output ul li::before {
    content: "•"; 
    color: var(--syntax-operator-char); /* Pink bullet */
    position: absolute;
    left: 0;
    top: 1px; /* Fine-tune vertical alignment */
    font-weight: bold;
    font-size: 0.9em;
}

/* Specific Syntax Elements */
.resume-output .syntax-key { /* For "Phone:", "Email:" etc. */
    color: var(--syntax-keyword); /* Pink */
    font-weight: 500;
}
.resume-output .syntax-value { /* For the value part of a key-value pair */
    color: var(--syntax-string-value); /* Yellow */
}
.resume-output .syntax-value-contact {
    color: var(--syntax-text-default); /* Contacts might be default text color */
}

.resume-output .syntax-tech { /* For C#, .NET, etc. */
    color: var(--syntax-entity-tag); /* Cyan */
    font-weight: 500;
}

.resume-output .syntax-job-title {
    color: var(--syntax-function-name); /* Green */
    font-weight: 500;
}
.resume-output .syntax-job-date {
    color: var(--syntax-comment); /* Greyish comment color for dates */
    font-style: italic;
}

.resume-output .syntax-achievement-marker { /* For "Achievements:" or "Достижения:" */
    color: var(--syntax-comment);
    font-style: italic;
    margin-right: 0.5em;
}
.resume-output .syntax-achievement-text {
    color: var(--syntax-text-default);
}

.resume-output .syntax-philosophy-item {
    color: var(--syntax-string-value); /* Yellow, like a string literal/quote */
    font-style: italic;
}
.resume-output .syntax-philosophy-item::before { /* Different bullet for philosophy */
    content: "-";
    color: var(--syntax-variable-name); /* Orange bullet */
}

.resume-output strong { /* Fallback for unstyled strong */
    color: var(--syntax-keyword); 
    font-size: 1em;
    font-weight: 500; 
}
.resume-output em { /* Fallback for unstyled em */
    color: var(--syntax-comment);
    font-style: italic;
}

.resume-output a {
    color: var(--syntax-entity-tag); /* Cyan for links */
    text-decoration: underline;
    text-decoration-style: dashed;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}
.resume-output a:hover {
    color: var(--syntax-function-name); /* Green on hover */
}

/* Print Styles - Keep as is from previous for brevity, assuming they are fine */

/* Стили для команды cat resume.md */
.syntax-cat-command {
    color: var(--syntax-output-dim);
    margin-top: 0.5rem;
    margin-bottom: 0.2rem;
    padding-bottom: 0.5rem;
    /* border-bottom removed to eliminate the dashed line */
}

/* Стили для индикатора загрузки */
.terminal-loader {
    margin: 1rem 0;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
@media print {
    /* Styles from previous code... */
    :root { /* Reset syntax colors for print */
        --syntax-text-default: #000000;
        --syntax-comment: #555555;
        --syntax-keyword: #000000;
        --syntax-function-name: #000000;
        --syntax-string-value: #000000;
        --syntax-variable-name: #000000;
        --syntax-entity-tag: #000000;
        --syntax-operator-char: #000000;
        --syntax-prompt-user: #000000;
        --syntax-prompt-path: #000000;
        --syntax-prompt-special: #000000;
    }
    body { background-image: none !important; background-color: white !important; color: black !important; font-family: "Times New Roman", Times, serif; font-size: 11pt; line-height: 1.4; }
    header.menu-bar, #profile-popup, .terminal-header, .terminal-initial-prompt, .language-toggle { display: none !important; }
    main { background-color: white !important; padding: 0 !important; }
    .terminal-window { box-shadow: none !important; border: none !important; background-color: white !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
    .terminal-content { padding: 0 !important; font-family: "Times New Roman", Times, serif !important; color: black !important; font-size: 11pt !important; line-height: 1.4 !important; white-space: normal !important; text-shadow: none !important; }
    .resume-output .syntax-command-main, .resume-output .syntax-command-section, .resume-output .syntax-command-subsection { color: #222 !important; font-family: "Georgia", serif !important; font-weight: bold !important; border-bottom: 1px solid #ccc; padding-left: 0 !important; }
    .resume-output .syntax-command-main::before, .resume-output .syntax-command-section::before, .resume-output .syntax-command-subsection::before { content: none !important; }
    .resume-output .syntax-prompt-user, .resume-output .syntax-prompt-path, .resume-output .syntax-prompt-dollar, .resume-output .syntax-prompt-arrow { display: none !important; }
    .resume-output .syntax-general-output, .resume-output ul { margin-left: 0 !important; }
    .resume-output ul { padding-left: 2em !important; list-style-type: disc !important; }
    .resume-output ul li::before { content: none !important; }
    .resume-output a { color: #0056b3 !important; text-decoration: underline !important; }
    .resume-output a[href^="http"]:after, .resume-output a[href^="mailto"]:after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
    .resume-output .syntax-key, .resume-output .syntax-value, .resume-output .syntax-value-contact, .resume-output .syntax-tech, .resume-output .syntax-job-title, .resume-output .syntax-job-date, .resume-output .syntax-achievement-marker, .resume-output .syntax-achievement-text, .resume-output .syntax-philosophy-item { color: black !important; font-style: normal !important; font-weight: normal !important; }
    .resume-output .syntax-key { font-weight: bold !important; }
    .resume-output .syntax-job-date, .resume-output .syntax-achievement-marker { font-style: italic !important; color: #555 !important; }
}


/* Responsive adjustments - Truncated for brevity,/* --- Modal photo (desktop only, macOS style) --- */
@media (min-width: 701px) {
  .terminal-photo-img.photo-pulse {
    position: relative;
    z-index: 1;
    box-shadow: 0 0 0 0 #ff5e8faa, 0 0 16px 3px #ff5e8f44;
    animation: photoPulse 1.2s infinite cubic-bezier(0.4,0,0.6,1);
    border-color: #ff5e8f;
    cursor: pointer;
    transition: box-shadow 0.18s, border-color 0.18s;
  }
  @keyframes photoPulse {
    0% {
      box-shadow: 0 0 0 0 #ff5e8faa, 0 0 24px 7px #ff5e8f44;
    }
    70% {
      box-shadow: 0 0 0 14px #ff5e8f00, 0 0 36px 13px #ff5e8f44;
    }
    100% {
      box-shadow: 0 0 0 0 #ff5e8f00, 0 0 24px 7px #ff5e8f44;
    }
  }

  body.light-theme .terminal-photo-img.photo-pulse {
    border-color: #6029c9 !important;
    box-shadow: 0 0 0 0 #6029c999, 0 0 16px 3px #6029c933;
    animation: photoPulseLight 1.2s infinite cubic-bezier(0.4,0,0.6,1);
  }
  @keyframes photoPulseLight {
    0% {
      box-shadow: 0 0 0 0 #6029c999, 0 0 24px 7px #6029c933;
    }
    70% {
      box-shadow: 0 0 0 14px #6029c900, 0 0 36px 13px #6029c933;
    }
    100% {
      box-shadow: 0 0 0 0 #6029c900, 0 0 24px 7px #6029c933;
    }
  }
}

@media (min-width: 701px) {
  .modal-photo-overlay {
    position: fixed;
    z-index: 10000;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalPhotoFadeIn 0.2s;
  }
  .modal-photo-window {
    background: var(--terminal-bg, #1e1e1e);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    padding: 0 0 24px 0;
    position: relative;
    max-width: 440px;
    width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    transform: scale(0.97);
    transition: transform 0.25s cubic-bezier(0.175,0.885,0.32,1.275);
  }
  .modal-photo-window.show {
    transform: scale(1);
  }
  .modal-photo-header {
    width: 100%;
    height: 32px;
    background: var(--window-header-bg, #303030);
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
    border-bottom: 1px solid rgba(0,0,0,0.13);
    user-select: none;
    -webkit-user-select: none;
  }
  .modal-macos-controls {
    display: flex;
    gap: 8px;
    margin-right: 12px;
  }
  .modal-macos-btn {
    width: 12px; height: 12px;
    border-radius: 50%;
    border: 0.5px solid rgba(0,0,0,0.18);
    display: inline-block;
    position: relative;
    box-shadow: 0 1px 2px #0003;
    cursor: pointer;
    transition: filter 0.15s;
  }
  .modal-macos-btn.close { background: #FF5F56; }
  .modal-macos-btn.min { background: #FFBD2E; }
  .modal-macos-btn.max { background: #27C93F; opacity: 0.5; cursor: not-allowed; pointer-events: none; }
  .modal-macos-btn.max:hover::after { display: none; }
  .modal-macos-btn.max::after { display: none; }

  .modal-macos-btn.close::after,
  .modal-macos-btn.min::after {
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    color: #222;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s;
    font-family: 'Fira Mono', 'Consolas', monospace;
    font-weight: bold;
    user-select: none;
  }
  .modal-macos-btn.close:hover::after {
    content: '\00D7'; /* × */
    opacity: 1;
  }
  .modal-macos-btn.min:hover::after {
    content: '\2013'; /* – */
    opacity: 1;
  }

  .modal-macos-btn:hover { filter: brightness(1.15); }
  .modal-photo-img-large {
    margin-top: 12px;
    max-width: 96vw;
    max-height: 60vh;
    border-radius: 10px;
    box-shadow: 0 0 16px #000a;
    background: #fff2;
    transition: box-shadow 0.2s;
    object-fit: contain;
    display: block;
  }
  @keyframes modalPhotoFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

    .terminal-window { max-width: 90%; height: calc(100vh - 28px - 30px); max-height: 90vh; }
    .terminal-content { font-size: 13px; padding: 15px; }
    .resume-output .syntax-command-main { font-size: 1.2em; }
    .resume-output .syntax-command-section { font-size: 1.1em; }
    .language-toggle { right: 10px; }
    .language-toggle button { padding: 2px 6px; font-size: 10px;}
    .terminal-title { max-width: calc(100% - 150px); }

@media (max-width: 1024px) {
    .terminal-window { max-width: 90%; height: calc(100vh - 28px - 30px); max-height: 90vh; }
    .terminal-content { font-size: 13px; padding: 15px; }
    .resume-output .syntax-command-main { font-size: 1.2em; }
    .resume-output .syntax-command-section { font-size: 1.1em; }
    .language-toggle { right: 10px; }
    .language-toggle button { padding: 2px 6px; font-size: 10px;}
    .terminal-title { max-width: calc(100% - 150px); }
}
@media (max-width: 768px) {
    .menu-bar { padding: 0 10px; }
    main { padding: 10px; }
    .terminal-window { width: calc(100% - 20px); max-width: 100%; height: calc(100vh - 28px - 20px); max-height: none; border-radius: 8px; }
    .terminal-header { height: 28px; padding: 0 10px; } /* Slightly increased for toggle */
    .window-controls > div { width: 10px; height: 10px; }
    .terminal-title { max-width: calc(100% - 130px); font-size: 12px; }
    .terminal-content { padding: 12px; font-size: 12px; line-height: 1.6; }
    .language-toggle { right: 8px; }
    .language-toggle button { padding: 2px 5px; font-size: 9px; }
}
@media (max-width: 480px) {
     .menu-bar { padding: 0 8px; }
     .center-menu, .right-menu { font-size: 10px; }
     main { padding: 5px; }
     .terminal-window { border-radius: 5px; height: calc(100vh - 28px - 10px); }
     .terminal-header { height: 26px; padding: 0 8px; }
     .window-controls > div { width: 9px; height: 9px; }
     .terminal-title { display: none; } /* Hide title on very small screens to make space for toggle */
     .terminal-content { padding: 10px; font-size: 11px; line-height: 1.55; }
     .language-toggle { right: 8px; gap: 3px; }
     .language-toggle button { padding: 2px 4px; font-size: 9px; min-width: 50px; }
}