/* ========================================================== */
/* Base & Global Styles                                       */
/* ========================================================== */

:root {
  --mac-blue: #007aff;
  --mac-light-bg: rgba(255, 255, 255, 0.3);
  --mac-sidebar-bg: rgba(240, 240, 240, 0.8);
  --mac-window-bg: rgba(255, 255, 255, 0.5);
  --text-color: #000;
  --file-text-color: #333;
  --menu-bar-height: 2vw;
  --desktop-extra-gap: 3vh;
  --desktop-top-offset: calc(var(--menu-bar-height) + var(--desktop-extra-gap));
  /* Dropdown shared styles */
  --dropdown-bg: var(--mac-light-bg);
  --dropdown-border: 1px solid rgba(255, 255, 255, 0.25);
  --dropdown-blur: blur(20px);
  --dropdown-radius: 16px;
  --dropdown-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  --dropdown-padding: 12px;
}

body.dark-mode {
  --mac-light-bg: rgba(20, 20, 30, 0.4);
  --mac-sidebar-bg: rgba(40, 40, 50, 0.8);
  --mac-window-bg: rgba(30, 30, 40, 0.5);
  --text-color: #fff;
  --file-text-color: #e0e0e0;
  /* Update dropdown border for dark mode */
  --dropdown-border: 1px solid rgba(255, 255, 255, 0.25);
}

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

html,
body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  color: var(--text-color);
  background: url("assets/Tahoe.jpg") center/cover no-repeat;
  backdrop-filter: blur(1px);
  transition: color 0.6s ease-in-out;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("assets/TahoeDark.jpg") center/cover no-repeat;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
  z-index: -1;
  pointer-events: none;
}

body.dark-mode::before {
  opacity: 1;
}

/* ========================================================== */
/* Lock Screen                                                */
/* ========================================================== */

.lock-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("assets/Tahoe.jpg") center/cover no-repeat;
  background-attachment: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10001;
  transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out;
  opacity: 1;
  visibility: visible;
}

.lock-screen::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(50px);
  z-index: 1;
  pointer-events: none;
}

.lock-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.lock-screen-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.lock-icon {
  font-size: 4rem;
  margin-bottom: 10px;
  animation: lockBounce 2s ease-in-out infinite;
}

@keyframes lockBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.lock-screen-content h1 {
  color: white;
  font-size: 2.5rem;
  margin: 0;
  font-weight: 300;
  letter-spacing: 0.5px;
  transition: opacity 0.2s ease-in-out;
}

.password-input {
  width: 250px;
  padding: 12px 16px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  color: white;
  text-align: center;
  transition: all 0.3s ease;
  font-family: inherit;
  letter-spacing: 0.15em;
}

.password-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.password-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.lock-hint {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  margin: 0;
  margin-top: 10px;
}

.error-message {
  color: #ff6b6b;
  font-size: 0.9rem;
  margin: 0;
  height: 20px;
  min-width: 250px;
  text-align: center;
}

/* ========================================================== */
/* Loading Screen                                             */
/* ========================================================== */

.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("assets/Tahoe.jpg") center/cover no-repeat;
  background-attachment: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out;
  opacity: 1;
  visibility: visible;
}

.loading-screen::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(80px);
  z-index: 1;
  pointer-events: none;
}

.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  position: relative;
  z-index: 2;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-screen.hidden::before {
  backdrop-filter: blur(0px);
}

.star-icon {
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.9);
  animation: starPulse 1.5s ease-in-out infinite;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

@keyframes starPulse {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

.loading-bar {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0.4) 100%);
  border-radius: 2px;
  animation: loadingBarAnimation 2s ease-in-out infinite;
}

@keyframes loadingBarAnimation {
  0% {
    width: 0%;
  }
  50% {
    width: 100%;
  }
  100% {
    width: 100%;
  }
}

/* ========================================================== */
/* Menu Bar                                                   */
/* ========================================================== */

.menu-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--menu-bar-height);
  background: rgba(0, 24, 66, 0.25);
  color: white;
  z-index: 9999;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.menu-left,
.menu-right {
  display: flex;
  align-items: center;
  gap: 2vw;
  padding: 0 2vw;
}

.menu-item-effect {
  padding: 0 0.5vw;
  border-radius: 8px;
  transition: background-color 0.3s ease;
}
.menu-item-effect:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.menu-bar a,
#logo,
#bysungyoon-link,
.music-icon,
#dark-mode-toggle {
  color: white !important;
  text-decoration: none !important;
  font-size: 1.3vw;
}

.music-icon,
#dark-mode-toggle {
  margin-right: 1.5vw;
}

/* ========================================================== */
/* Dropdown Menus                                             */
/* ========================================================== */

.menu-dropdown {
  position: absolute;
  top: calc(var(--menu-bar-height) + 5px);
  background: var(--dropdown-bg);
  backdrop-filter: var(--dropdown-blur);
  border-radius: var(--dropdown-radius);
  box-shadow: var(--dropdown-shadow);
  border: var(--dropdown-border);
  display: none;
  padding: var(--dropdown-padding);
  transition: background 0.6s ease-in-out, border-color 0.6s ease-in-out, color 0.6s ease-in-out;
  min-width: 280px;
  color: var(--text-color);
}

body.dark-mode .menu-dropdown {
  background: rgba(20, 20, 30, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

#music-menu {
  flex-direction: column;
  align-items: center;
}

.menu-dropdown .menu-item-title {
  margin-bottom: 10px;
  padding-bottom: 0;
  position: relative;
}

#music-menu .menu-item-title {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.menu-dropdown .menu-item-title p {
  margin: 0;
  color: var(--text-color);
  font-weight: 700;
  font-size: 1.8vw;
  transition: color 0.6s ease-in-out;
}

.menu-dropdown p {
  color: var(--text-color);
  font-size: 1.3vw;
  margin: 6px 0;
  transition: color 0.6s ease-in-out;
}

.sns {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5vw;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}
.sns a i {
  color: var(--text-color);
  font-size: 2vw;
  transition: color 0.3s ease;
}
.sns a .fa-linkedin:hover {
  color: #0a66c2 !important;
}
.sns a .fa-instagram:hover {
  color: #e1306c !important;
}
.sns a .fa-youtube:hover {
  color: #ff0000 !important;
}
.sns a .fa-soundcloud:hover {
  color: #ff7700 !important;
}

.menu-item {
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 1.3vw;
}

.menu-item:first-child {
  border-top: none;
}

.menu-item a {
  color: #0084ff;
  transition: color 0.6s ease-in-out;
  text-decoration: none;
}

.menu-item a:hover {
  text-decoration: underline;
}

#contact-menu a {
  color: #0084ff !important;
  transition: color 0.6s ease-in-out;
}

#contact-menu a:hover {
  text-decoration: underline !important;
}

body.dark-mode #contact-menu a {
  color: #0084ff !important;
}

body.dark-mode #contact-menu a:hover {
  text-decoration: underline !important;
}

/* ========================================================== */
/* Desktop Layout & Icons                                     */
/* ========================================================== */

.desktop {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  height: calc(100dvh - var(--menu-bar-height));
  padding-top: var(--desktop-top-offset);
  padding-right: 1vw;
  gap: 2vw;
}

.icon-column {
  display: flex;
  flex-direction: column;
  gap: 2vw;
}

.icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 8vw;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.icon img {
  width: 4.5vw;
  height: 4.5vw;
}
.icon span {
  margin-top: 0.5vw;
  font-size: 0.8vw;
  color: white;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}
.icon:hover {
  transform: scale(1.05);
}

.icon.bin {
  position: absolute;
  bottom: 2vw;
  right: 2vw;
}

@media (max-width: 800px) {
  .icon.bin {
    position: static;
    bottom: auto;
    right: auto;
  }
}

/* iPad/Tablet specific fixes (800px - 1200px) */
@media (min-width: 801px) and (max-width: 1200px) {
  .window {
    max-width: 96vw !important;
  }
}

/* ========================================================== */
/* Windows & Sidebar                                          */
/* ========================================================== */

.window {
  position: absolute;
  background: var(--mac-window-bg);
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  resize: both;
  min-width: 250px;
  min-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
}

.window:not(.no-animation) {
  animation: genieOpen 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes genieOpen {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Resize handles for all four corners */
.window::before,
.window::after {
  content: '';
  position: absolute;
  background: transparent;
  z-index: 100;
  cursor: se-resize;
}

.window::before {
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  cursor: se-resize;
}

.window::after {
  bottom: 0;
  left: 0;
  width: 20px;
  height: 20px;
  cursor: sw-resize;
}

.resize-handle-ne {
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  cursor: ne-resize;
  z-index: 100;
}

.resize-handle-nw {
  position: absolute;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  cursor: nw-resize;
  z-index: 100;
}

.title-bar {
  background: rgba(255, 255, 255, 0.8);
  padding: 4px 4px 4px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
  user-select: none;
  font-weight: 600;
  color: #000;
  transition: background 0.6s ease-in-out, color 0.6s ease-in-out;
}

body.dark-mode .title-bar {
  background: rgba(0, 0, 0, 0.8);
  color: white;
}

.close-btn {
  width: 15px;
  height: 15px;
  background-color: #ff5f56;
  border-radius: 50%;
  border: none;
  opacity: 0.7;
  cursor: pointer;
  margin-right: 10px;
}
.close-btn:hover {
  background-color: #ff3b30;
  opacity: 1;
}

@media (max-width: 800px) {
  .close-btn {
    width: 24px;
    height: 24px;
  }
}

.sidebar {
  background: var(--mac-sidebar-bg);
  border-radius: 10px;
  margin: 10px 0 10px 10px;
  padding: 5px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar a {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px;
  text-decoration: none;
  color: var(--file-text-color);
  border-radius: 5px;
  font-size: 0.8vw;
  transition: color 0.6s ease-in-out, background 0.3s ease;
}
.sidebar a:hover {
  background: rgba(0, 0, 0, 0.1);
}
.sidebar a img {
  width: 2vw;
  height: 2vw;
}

/* ========================================================== */
/* Window Content + Media                                     */
/* ========================================================== */

.window-content {
  flex: 1;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  height: 100%;
  box-sizing: border-box;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  height: 100%;
  overflow: auto;
  padding: 10px;
  padding-bottom: 30px;
}

.main-content.cv-content {
  padding-bottom: 10px;
}

.description,
.main-content h2,
.main-content h3,
.main-content p {
  font-size: 20px;
  line-height: 1.6;
}

.main-content h2 {
  font-size: 20px;
  margin-top: 15px;
  margin-bottom: 10px;
  font-weight: 600;
}

.main-content h3 {
  font-size: 18px;
  margin-top: 10px;
  margin-bottom: 8px;
  font-weight: 600;
}

.title {
  font-size: 18px;
}

.project-title {
  font-size: 24px !important;
  font-weight: 600;
  margin: 15px 0 10px 0;
}

.projects-container .description {
  font-size: 20px !important;
  margin-bottom: 10px;
}

.sonics-title {
  font-size: 24px !important;
  font-weight: 600;
  margin: 15px 0 10px 0;
}

.sonics-container .description {
  font-size: 20px !important;
  margin-bottom: 10px;
}

.hobbies-heading {
  font-size: 32px !important;
  font-weight: 600;
}

.hobbies-description-text {
  font-size: 22px !important;
  line-height: 1.6;
}

.main-content iframe,
.main-content video {
  display: block;
  width: 100%;
  border: none;
  border-radius: 8px;
  margin: 0;
}

.main-content iframe[src$=".pdf"],
.main-content iframe[src*="CV_Resume"] {
  flex: 1;
  width: 100%;
  height: auto;
  min-height: auto;
  border: none;
  overflow: visible;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.filmcontainer iframe,
.sonics-container iframe {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  margin: 15px 0;
}

.projects-container {
  display: flex;
  flex-direction: column;
}

.projects-container > div {
  text-align: center;
}

.projects-container h3,
.projects-container p {
  text-align: center;
}

.sonics-container {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.projects-container iframe {
  width: 100% !important;
  margin: 0 auto 15px auto;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: #000;
}

.projects-container img {
  width: 70% !important;
  height: auto !important;
  margin: 0 auto 15px auto;
}

.projects-container > div {
  display: flex;
  flex-direction: column;
}

.projects-container > div {
  display: flex;
  flex-direction: column;
}

/* Project and sonics dividers */
.project-divider,
.sonics-divider {
  border: none;
  border-top: 2px solid rgba(0, 0, 0, 0.15);
  margin: 40px 0;
}

body.dark-mode .project-divider,
body.dark-mode .sonics-divider {
  border-top-color: rgba(255, 255, 255, 0.15);
}

.sonics-section iframe[src*="soundcloud.com"] {
  width: 100%;
  height: 300px;
  border-radius: 12px;
}

/* ========================================================== */
/* About Me                                                   */
/* ========================================================== */

.about-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-left: 10px;
}
.about-section {
  display: flex;
  align-items: center;
  gap: 20px;
}
.about-section p {
  font-size: 20px;
}
.about-text-right {
  flex-direction: row;
}
.about-text-left {
  flex-direction: row-reverse;
}
.about-photo {
  max-width: 300px;
  border-radius: 10px;
}

.about-section:first-of-type .about-photo {
  max-width: 200px;
}

.hello {
  margin-top: 0;
}

/* ========================================================== */
/* Visuals                                                    */
/* ========================================================== */

.visuals-container {
  column-count: 3;
  column-gap: 10px;
}
.visuals-container img {
  width: 100%;
  margin-bottom: 10px;
  border-radius: 5px;
  display: block;
  break-inside: avoid;
}
.window.visuals-1-column .visuals-container {
  column-count: 1 !important;
  column-gap: 0 !important;
}

/* ========================================================== */
/* Widgets & Clocks                                           */
/* ========================================================== */
.widget-container {
  position: absolute;
  top: var(--desktop-top-offset);
  left: 3vw;
  display: flex;
  flex-direction: column;
  gap: 1vw;
}

/* Hide mobile widgets on desktop and tablet */
#mobile-widgets {
  display: none;
}

.time-widget {
  background-color: var(--mac-light-bg);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  color: var(--text-color);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  height: 10vw;
  width: 18vw;
  padding-left: 2vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.4;
  transition: color 0.6s ease-in-out, background-color 0.6s ease-in-out;
}
.widget-title {
  font-size: 1.4vw;
  font-weight: 700;
  margin-bottom: 0.2em;
}
.widget-date {
  font-size: 0.9vw;
  margin-bottom: 0.3em;
}
.widget-time {
  font-size: 1.8vw;
}

@media (max-width: 800px) {
  .time-widget {
    padding-left: 3vw;
    margin: 8px 0;
  }

  .widget-title {
    font-size: 4.5vw;
  }

  .widget-date {
    font-size: 3.5vw;
  }

  .widget-time {
    font-size: 5vw;
  }

  .main-content iframe[src$=".pdf"],
  .main-content iframe[src*="CV_Resume"] {
    touch-action: pan-y pinch-zoom;
    height: 90vh;
  }
}

/* ========================================================== */
/* macOS Icon Highlights                                      */
/* ========================================================== */

.icon,
.file {
  position: relative;
  transition:
    transform 0.2s ease,
    filter 0.3s ease;
}

.icon img,
.file img {
  border-radius: 10px;
  transition:
    box-shadow 0.25s ease,
    background 0.25s ease,
    transform 0.2s ease;
}

.icon span,
.file span {
  position: relative;
  z-index: 2;
  background: transparent;
  border-radius: 6px;
  padding: 0.2vw 0.4vw;
  transition:
    background 0.25s ease,
    color 0.25s ease;
}

.icon:hover img,
.file:hover img,
.icon.selected img,
.file.selected img {
  background: rgba(255, 255, 255, 0.15);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.25),
    0 2px 6px rgba(0, 0, 0, 0.2),
    inset 0 0 8px rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
}

.icon:hover span,
.file:hover span,
.icon.selected span,
.file.selected span {
  background: var(--mac-blue);
  color: white;
  box-shadow: 0 0 6px rgba(0, 122, 255, 0.3);
}

.icon:hover,
.file:hover {
  transform: scale(1.04);
}

/* ========================================================== */
/* File Icons (Finder Folder Layout)                          */
/* ========================================================== */

.folder-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* centres horizontally */
  align-items: center; /* centres vertically */
  gap: 2vw; /* spacing between icons */
  padding: 0;
  height: 100%;
  box-sizing: border-box;
}

.file {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 8vw;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    filter 0.3s ease;
}

.file img {
  width: 5vw;
  height: 5vw;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
  transition:
    box-shadow 0.25s ease,
    background 0.25s ease,
    transform 0.2s ease;
}

.file span {
  margin-top: 0.3vw;
  font-size: 0.8vw;
  color: var(--file-text-color);
  text-align: center;
  border-radius: 6px;
  padding: 0.2vw 0.4vw;
  transition:
    background 0.25s ease,
    color 0.6s ease-in-out;
}

.file:hover img {
  background: rgba(255, 255, 255, 0.15);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.25),
    0 2px 6px rgba(0, 0, 0, 0.2),
    inset 0 0 8px rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
}

.file:hover span {
  background: var(--mac-blue);
  color: white;
  box-shadow: 0 0 6px rgba(0, 122, 255, 0.3);
}

.file:hover {
  transform: scale(1.04);
}

/* ========================================================== */
/* Music Controls & Buttons                                   */
/* ========================================================== */

.music-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  padding: 8px 0;
  margin-top: 8px;
}

.music-controls .control-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.music-controls .control-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.music-controls .control-btn i {
  font-size: 1.4vw;
  color: var(--text-color);
  transition: color 0.6s ease-in-out;
}

.music-controls .control-btn i:hover {
  color: var(--mac-blue);
}

body.dark-mode .music-controls .control-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .music-controls .control-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Music menu - narrower width */
#music-menu {
  min-width: 220px !important;
}

/* ========================================================== */
/* Responsive Tweaks (Tablet)                                 */
/* ========================================================== */

@media (max-width: 1000px) {
  .visuals-container {
    column-count: 2;
  }
}

@media (max-width: 800px) {
  /* ========== IPHONE-STYLE REDESIGN ========== */
  
  /* Desktop icons visible - they trigger window opening */
  .desktop {
    position: fixed;
    top: 5vh;
    left: 0;
    right: 0;
    bottom: 12vh;
    width: 90%;
    height: auto;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    padding: 5px 0;
    z-index: 100;
    box-sizing: border-box;
  }

  .icon-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    align-items: center;
  }

  .icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-align: center;
    margin-bottom: 0;
  }

  .icon img {
    width: 24vw;
    height: 24vw;
  }

  .icon span {
    font-size: 4vw;
    margin-top: 8px;
    display: block;
  }

  /* Hide old sidebar and about sections in desktop main layout */
  .sidebar {
    display: none !important;
  }

  .desktop .about-section {
    display: none !important;
  }

  /* Top menu bar */
  .menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: max(env(safe-area-inset-top), 12px) 16px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 1000;
  }

  .menu-left,
  .menu-right {
    display: none !important;
  }

  /* iPhone-style title */
  .menu-bar::before {
    content: "bysungyoon.";
    font-size: 7vw;
    font-weight: 600;
    letter-spacing: -0.5px;
  }

  /* Dock indicator bar - separator above the dock */
  .dock-indicator-bar {
    position: fixed;
    bottom: calc(max(env(safe-area-inset-bottom), 60px) + 25px);
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 35px;
    background: var(--mac-light-bg);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    z-index: 500;
    cursor: pointer;
    transition: background 0.6s ease-in-out, border-color 0.6s ease-in-out, opacity 0.3s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-color);
  }

  .dock-indicator-bar i {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    height: 100%;
  }

  .dock-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 6px;
    font-size: 16px;
    line-height: 1;
  }

  .dock-indicator-bar:hover {
    background: rgba(255, 255, 255, 0.5);
  }

  .dark-mode .dock-indicator-bar:hover {
    background: rgba(20, 20, 30, 0.5);
  }

  /* Bottom iOS-style tab bar */
  .ios-tab-bar {
    position: fixed;
    bottom: 0;
    left: 10px;
    right: 10px;
    width: calc(100% - 20px);
    height: max(env(safe-area-inset-bottom), 60px);
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(15px);
    border-top: none;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    display: flex !important;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: 8px;
    z-index: 1000;
    transition: background 0.6s ease-in-out, border-color 0.6s ease-in-out;
    margin: 0 0 10px 0;
    overflow: visible;
  }

  body.dark-mode .ios-tab-bar {
    background: rgba(20, 20, 30, 0.25);
    border-color: rgba(255, 255, 255, 0.2);
  }

  .mobile-menu-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .ios-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 8px;
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.6s ease-in-out;
  }

  .ios-tab-item i {
    font-size: 6vw;
  }

  .ios-tab-item span {
    font-size: 2.5vw;
    display: none;
  }

  /* Mobile menu dropdowns */
  .mobile-menu-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .mobile-menu-dropdown .menu-item-title {
    text-align: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
  }

  .mobile-menu-dropdown .menu-item-title p {
    margin: 0;
    font-weight: 700;
    font-size: 4.5vw;
    color: var(--text-color);
  }

  .mobile-menu-dropdown .menu-item {
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 3vw;
  }

  .mobile-menu-dropdown .menu-item:first-child {
    border-top: none;
  }

  .mobile-menu-dropdown .menu-item p {
    margin: 0;
    color: var(--text-color);
    transition: color 0.6s ease-in-out;
  }

  .mobile-menu-dropdown .menu-item a {
    color: #0084ff;
    text-decoration: none;
  }

  .mobile-menu-dropdown .menu-item a:hover {
    text-decoration: underline;
  }

  .mobile-menu-dropdown .sns {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 12px 0 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }

  .mobile-menu-dropdown .sns a {
    font-size: 8vw;
    color: var(--text-color);
    transition: color 0.6s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-menu-dropdown .sns a i {
    font-size: 8vw;
  }

  .mobile-menu-dropdown .music-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 12px 0;
  }

  .mobile-menu-dropdown .control-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 5vw;
    cursor: pointer;
    padding: 8px;
    transition: color 0.6s ease-in-out;
  }

  .mobile-menu-dropdown .current-track {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 2.8vw;
    color: var(--text-color);
    text-align: center;
    line-height: 1.3;
    transition: color 0.6s ease-in-out;
  }

  #desktop-current-track {
    margin: 8px auto 0;
    padding-top: 12px;
    font-size: 14px;
    color: var(--text-color);
    text-align: center;
    line-height: 1.3;
    transition: color 0.6s ease-in-out;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }

  body.dark-mode .mobile-menu-dropdown {
    background: rgba(20, 20, 30, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
  }

  /* iOS card-style windows */
  .window {
    position: fixed !important;
    display: flex !important;
    flex-direction: column !important;
    z-index: 100 !important;
    border-radius: 20px !important;
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.4s ease-out;
  }

  @keyframes slideUp {
    from {
      opacity: 0;
      transform: translateY(-50%);
    }
    to {
      opacity: 1;
      transform: translateY(-50%);
    }
  }

  /* Window title bar - cleaner */
  .title-bar {
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 12px 16px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .title-bar span {
    font-size: 5vw !important;
    font-weight: 600;
    color: var(--text-color);
  }

  .title-bar h3 {
    font-size: 5vw !important;
    font-weight: 600;
    margin: 0 !important;
    color: var(--text-color);
  }

  .window-controls {
    display: flex !important;
    gap: 8px;
  }

  .window-controls button {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 12px;
  }

  .close-btn {
    background: #ff5f57 !important;
  }

  /* Window content scrollable */
  .window-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
  }

  /* Hide original menu dropdowns */
  .menu-dropdown {
    display: none !important;
  }

  /* Music player as card */
  .music-player-section {
    position: fixed !important;
    bottom: 70px;
    left: 2.5vw;
    right: 2.5vw;
    width: 95vw;
    padding: 16px !important;
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(20px) !important;
    border-radius: 16px !important;
    border: none !important;
    z-index: 400;
  }

  .music-controls {
    gap: 12px;
    padding: 0;
    background: transparent;
    display: flex;
    justify-content: center;
  }

  .music-controls .control-btn {
    width: 12vw;
    height: 12vw;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .music-controls .control-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.5);
  }

  .music-controls .control-btn i {
    font-size: 5vw !important;
  }

  /* Text sizing */
  .about-section p {
    font-size: 4vw;
    line-height: 1.6;
  }

  .project-title {
    font-size: 5vw !important;
  }

  .description {
    font-size: 3.5vw !important;
  }

  .sonics-title {
    font-size: 5vw !important;
  }

  /* Responsive iframe sizing */
  iframe {
    width: 100% !important;
    height: auto !important;
    min-height: 50vh;
    border-radius: 12px;
  }

  /* Gallery images */
  .cv-gallery {
    gap: 16px !important;
    padding: 16px !important;
    padding-bottom: max(100px, 100px + env(safe-area-inset-bottom)) !important;
  }

  .cv-image-item {
    width: 100% !important;
    max-width: none !important;
  }

  /* Visuals/photos layout on mobile - single column */
  .visuals-container {
    column-count: 1 !important;
    column-gap: 0 !important;
  }

  .visuals-container img {
    width: 100% !important;
    margin-bottom: 10px !important;
  }

  /* Lock screen for mobile */
  .lock-screen-content {
    padding: 20px;
    text-align: center;
  }

  .lock-icon {
    font-size: 12vw;
    margin-bottom: 16px;
  }

  #helloText {
    font-size: 8vw !important;
    margin: 16px 0;
  }

  .password-input {
    width: 80vw;
    padding: 12px 16px;
    font-size: 4vw;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    margin: 20px 0;
  }

  .lock-hint,
  .error-message {
    font-size: 3vw;
  }
}

@media (max-width: 500px) {
  .icon img {
    width: 15vw;
    height: 15vw;
  }
}

/* ========================================================== */
/* Hobbies Section                                            */
/* ========================================================== */

.hobbies-wrapper {
  padding: 20px;
  height: auto;
  display: flex;
  flex-direction: column;
  overflow-y: visible;
}

.hobbies-header {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  flex-direction: row-reverse;
}

.hobbies-main-image {
  width: 120px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.hobbies-heading {
  font-size: 2vw;
  margin: 0 0 10px 0;
  color: var(--text-color);
  transition: color 0.6s ease-in-out;
  line-height: 1.4;
}

.hobbies-header-text {
  flex: 1;
}

.hobbies-description-text {
  font-size: 1.4vw;
  color: var(--text-color);
  transition: color 0.6s ease-in-out;
  margin: 0;
  line-height: 1.5;
}

.hobbies-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, 200px);
  gap: 60px;
  margin-bottom: 20px;
  align-content: start;
  justify-content: start;
}

.hobby-item {
  width: 200px;
  text-align: center;
  transition: transform 0.3s ease;
  margin-top: calc(var(--random-offset, 0px));
  display: flex;
  flex-direction: column;
}

.hobby-item:nth-child(1) { margin-top: 0px; }
.hobby-item:nth-child(2) { margin-top: 30px; }
.hobby-item:nth-child(3) { margin-top: 15px; }
.hobby-item:nth-child(4) { margin-top: 45px; }
.hobby-item:nth-child(5) { margin-top: 10px; }
.hobby-item:nth-child(6) { margin-top: 40px; }
.hobby-item:nth-child(7) { margin-top: 25px; }
.hobby-item:nth-child(8) { margin-top: 35px; }
.hobby-item:nth-child(9) { margin-top: 20px; }

.hobby-item:hover {
  transform: scale(1.05);
}

.hobby-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  margin-bottom: 8px;
}

.hobby-item .hobby-video {
  width: 100%;
  height: 200px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  margin-bottom: 8px;
  background: #000;
  object-fit: cover;
}

.hobby-description {
  font-size: 1.1vw;
  color: var(--text-color);
  margin: 0;
  transition: color 0.6s ease-in-out;
}

/* Mobile: 2-column grid layout */
/* ========================================================== */
/* Mobile-Only Fixes & Adjustments (DO NOT AFFECT DESKTOP) */
/* ========================================================== */
@media (max-width: 800px) {
  .about-content-wrapper {
    padding-bottom: max(100px, 100px + env(safe-area-inset-bottom));
  }

  .about-section:last-child .about-photo {
    margin-bottom: max(100px, 100px + env(safe-area-inset-bottom));
    max-width: 220px !important;
  }

  /* About lightbox styles */
  .about-lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow: auto;
  }

  .about-lightbox.active {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
  }

  .about-lightbox-content {
    position: relative;
    width: 90%;
    max-width: 90vh;
    height: auto;
    max-height: 90vh;
  }

  .about-lightbox img {
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
    animation: zoomIn 0.3s ease;
  }

  .about-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 32px;
    color: white;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    transition: background 0.2s ease;
    z-index: 10001;
  }

  .about-lightbox-close:hover {
    background: rgba(0, 0, 0, 0.8);
  }

  .visuals-wrapper {
    padding-bottom: max(100px, 100px + env(safe-area-inset-bottom));
  }

  .projects-container {
    padding-bottom: max(100px, 100px + env(safe-area-inset-bottom));
  }

  .sonics-container {
    padding-bottom: max(100px, 100px + env(safe-area-inset-bottom));
  }

  .sonics-section {
    padding-bottom: max(100px, 100px + env(safe-area-inset-bottom));
  }

  .filmcontainer {
    padding-bottom: max(100px, 100px + env(safe-area-inset-bottom));
  }

  .hobbies-wrapper {
    padding-bottom: max(100px, 100px + env(safe-area-inset-bottom));
  }

  /* Show dock indicator bar on mobile */
  .dock-indicator-bar {
    display: block !important;
    backdrop-filter: blur(15px) !important;
  }

  /* Mobile menu dropdown */
  .mobile-menu-dropdown {
    position: fixed;
    bottom: 95px;
    background: rgba(255, 255, 255, 0.35);
    -webkit-backdrop-filter: blur(30px);
    backdrop-filter: blur(30px);
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    padding: 12px;
    min-width: 280px;
    max-width: 90%;
    z-index: 50000 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    left: 50%;
    margin-left: -140px;
  }

  /* Hide music player section on mobile */
  .music-player-section {
    display: none !important;
  }

  /* Hide menu bar on mobile */
  .menu-bar {
    display: none !important;
  }

  /* Show sidebar as bottom navigation bar on mobile windows */
  .sidebar {
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 10px;
    margin: 0;
    background: var(--mac-light-bg);
    backdrop-filter: blur(15px);
    border-radius: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: none;
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
    justify-content: space-around;
    align-items: center;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    max-height: 80px;
  }

  .sidebar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    font-size: 2.5vw;
    white-space: nowrap;
    text-decoration: none;
    color: var(--file-text-color);
  }

  .sidebar a img {
    display: none;
  }

  .sidebar a::before {
    content: '';
    width: 30px;
    height: 30px;
    display: block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }

  /* iOS icon styles for sidebar items */
  .sidebar a[data-link="projects"]::before {
    background-image: url('assets/projects_ios.png');
  }

  .sidebar a[data-link="visuals"]::before {
    background-image: url('assets/visual_ios.png');
  }

  .sidebar a[data-link="sonics"]::before {
    background-image: url('assets/sonics_ios.png');
  }

  .sidebar a[data-link="about me"]::before {
    background-image: url('assets/aboutme_ios.png');
  }

  .sidebar a[data-link="cv/resume"]::before {
    background-image: url('assets/cv_ios.png');
  }

  .sidebar a span {
    font-size: 2vw;
  }

  /* Keep desktop visible but restructure it */
  .desktop {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    height: auto !important;
    padding: 20px !important;
    justify-items: center !important;
    margin-top: 20px !important;
    margin-bottom: 80px !important;
  }

  /* Restructure desktop icon columns to grid items */
  .desktop .icon-column {
    display: contents !important;
  }

  /* Hide bin on mobile */
  .desktop .bin {
    display: none !important;
  }

  /* Hide the window template - should never be visible */
  #window-template {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* Show windows on mobile - they're hidden by default in HTML but shown when created */
  .desktop .window:not(#window-template) {
    display: flex !important;
  }

  /* Show files/folders in mobile grid */
  .desktop .icon {
    width: auto;
    text-align: center;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* Hide image icons on mobile, show iOS-style icons */
  .desktop .icon img {
    display: none;
  }

  .desktop .icon::before {
    content: '';
    width: 20vw;
    height: 20vw;
    display: block;
    margin-bottom: 8px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }

  /* iOS-style icons for each folder/file */
  .desktop .icon[data-folder="projects"]::before {
    background-image: url('assets/projects_ios.png');
  }

  .desktop .icon[data-folder="visuals"]::before {
    background-image: url('assets/visual_ios.png');
  }

  .desktop .icon[data-folder="sonics"]::before {
    background-image: url('assets/sonics_ios.png');
  }

  .desktop .icon[data-file="about me"]::before {
    background-image: url('assets/aboutme_ios.png');
  }

  .desktop .icon[data-file="cv/resume"]::before {
    background-image: url('assets/cv_ios.png');
  }

  .desktop .icon.bin::before {
    background-image: url('assets/bin_ios.png');
  }

  .desktop .icon span {
    font-size: 3.5vw;
    margin-top: 8px;
  }

  /* Hide desktop widget container on mobile */
  .widget-container {
    display: none !important;
  }

  #mobile-widgets {
    display: flex !important;
    grid-column: 1 / -1 !important;
    width: 95%;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-direction: row;
    gap: 0;
    justify-content: space-around;
    justify-self: center !important;
    margin-top: -40px !important;
    margin-bottom: 10px !important;
    order: -1 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    z-index: 100 !important;
  }

  body.dark-mode #mobile-widgets {
    background: rgba(20, 20, 30, 0.25);
    border-color: rgba(255, 255, 255, 0.2);
  }

  #desktop-widgets {
    display: none !important;
  }

  /* Close button fix - ensure it's clickable on mobile */
  .window .close-btn {
    pointer-events: auto !important;
    z-index: 10000 !important;
    position: relative !important;
    cursor: pointer !important;
    background-color: #ff5f57 !important;
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    border: none !important;
    padding: 0 !important;
    display: block !important;
  }

  /* Increase file icon sizes in folder windows on mobile */
  .file {
    width: auto;
  }

  .file img {
    width: 20vw;
    height: 20vw;
  }

  .file span {
    font-size: 3vw;
    margin-top: 8px;
  }

  .window .title-bar {
    pointer-events: auto;
    z-index: 9999;
  }

  /* Make title bar sticky for full-size pages on mobile */
  .window.visuals-1-column .title-bar,
  .window:has(.about-content-wrapper) .title-bar,
  .window:has(.cv-gallery) .title-bar,
  .window:has(.hobbies-wrapper) .title-bar,
  .window:has(.projects-container) .title-bar,
  .window:has(.sonics-container) .title-bar,
  .window:has(.sonics-section) .title-bar,
  .window:has(.filmcontainer) .title-bar {
    position: sticky;
    top: 0;
    z-index: 10000;
    background: rgba(255, 255, 255, 1) !important;
  }

  body.dark-mode .window.visuals-1-column .title-bar,
  body.dark-mode .window:has(.about-content-wrapper) .title-bar,
  body.dark-mode .window:has(.cv-gallery) .title-bar,
  body.dark-mode .window:has(.hobbies-wrapper) .title-bar,
  body.dark-mode .window:has(.projects-container) .title-bar,
  body.dark-mode .window:has(.sonics-container) .title-bar,
  body.dark-mode .window:has(.sonics-section) .title-bar,
  body.dark-mode .window:has(.filmcontainer) .title-bar {
    background: rgba(30, 30, 40, 1) !important;
  }

  body.dark-mode .window.visuals-1-column,
  body.dark-mode .window:has(.about-content-wrapper),
  body.dark-mode .window:has(.cv-gallery),
  body.dark-mode .window:has(.hobbies-wrapper),
  body.dark-mode .window:has(.projects-container),
  body.dark-mode .window:has(.sonics-container),
  body.dark-mode .window:has(.sonics-section),
  body.dark-mode .window:has(.filmcontainer) {
    background: rgba(20, 20, 30, 0.95) !important;
  }

  /* Dark mode for all windows on mobile */
  body.dark-mode .window {
    background: rgba(20, 20, 30, 0.8) !important;
  }

  /* Window fixes for mobile */
  .window {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 95vw !important;
    height: auto !important;
    max-height: 80dvh !important;
    border-radius: 20px !important;
    z-index: 5000 !important;
    overflow-y: auto !important;
  }

  /* Full-size windows (pages like about me, cv, bin) open full screen on mobile */
  .window.visuals-1-column,
  .window:has(.about-content-wrapper),
  .window:has(.cv-gallery),
  .window:has(.hobbies-wrapper),
  .window:has(.projects-container),
  .window:has(.sonics-container),
  .window:has(.sonics-section),
  .window:has(.filmcontainer) {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 16px !important;
    overflow-y: auto !important;
  }

  .window-content {
    overflow: visible !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
  }

  /* Scrollable content area on mobile */
  .scrollable-content {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: max(180px, 180px + env(safe-area-inset-bottom));
    max-height: calc(100dvh - 100px);
  }

  /* Full-size content: expand to fill window */
  .window.visuals-1-column .scrollable-content {
    flex: 1;
  }

  /* Remove vertical centering from folder content on mobile */
  .folder-content {
    align-items: center;
    justify-content: space-evenly;
    height: auto;
    min-height: 100%;
    padding-top: 10px;
    padding-left: 10px;
    padding-right: 10px;
  }

  /* iOS-specific about me text size */
  .about-section p {
    font-size: 5vw !important;
  }

  /* iOS-specific bin/hobbies text size - match about me */
  .hobbies-heading {
    font-size: 5vw !important;
  }

  .hobbies-description-text {
    font-size: 5vw !important;
  }

  .hobby-description {
    font-size: 4vw !important;
  }

  /* iOS-specific smaller photos */
  .about-photo {
    max-width: 180px !important;
  }

  .about-section:first-of-type .about-photo {
    max-width: 140px !important;
  }

  .main-content {
    overflow: visible !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    min-height: 100%;
  }

  /* When sidebar is removed, main-content should fill entire window */
  .window-content:has(> .main-content:only-child) .main-content {
    width: 100%;
    height: 100%;
  }

  /* Mobile time widget styling - only when in #mobile-widgets */
  #mobile-widgets .time-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex: 1;
    padding: 16px 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent !important;
    backdrop-filter: none;
    width: auto !important;
    height: auto !important;
    min-height: 120px;
  }

  #mobile-widgets .time-widget:last-child {
    border-right: none;
  }

  #mobile-widgets .widget-title {
    font-size: 4.5vw;
    font-weight: 700;
    margin-bottom: 8px;
    height: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #mobile-widgets .widget-date {
    font-size: 3.2vw;
    opacity: 0.7;
    margin-bottom: 10px;
    height: 1.3em;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
  }

  #mobile-widgets .widget-time {
    font-size: 6.5vw;
    font-weight: 600;
    letter-spacing: -0.5px;
    height: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Mobile about page styles */
  .about-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }

  .about-section {
    display: flex;
    flex-direction: column !important;
    align-items: center;
    gap: 15px;
    text-align: center;
  }

  .about-text-right,
  .about-text-left {
    flex-direction: column !important;
  }

  .about-section p {
    font-size: 3.5vw;
    line-height: 1.6;
  }

  .about-photo {
    max-width: 90vw;
    width: 100%;
    border-radius: 10px;
  }

  .about-section:first-of-type .about-photo {
    max-width: 90vw;
  }

  .hello {
    margin-top: 0;
  }

  /* Mobile project and sonics dividers */
  .project-divider,
  .sonics-divider {
    margin: 30px 0;
    border-top-width: 1px;
  }

  /* Mobile hobbies page styles */
  .hobbies-wrapper {
    padding: 15px;
  }

  .hobbies-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    gap: 15px;
  }

  .hobbies-main-image {
    width: 120px;
    height: 120px;
  }

  .hobbies-heading {
    font-size: 5vw;
    margin: 0;
  }

  .hobbies-description-text {
    font-size: 3vw;
    margin: 5px 0;
  }

  .hobbies-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    justify-items: center;
    padding-bottom: 10vh;
  }

  .hobby-item {
    width: 100%;
    max-width: 160px;
    transform: rotate(0deg) !important;
    margin-top: 0 !important;
  }

  .hobby-item img,
  .hobby-item .hobby-video {
    width: 100%;
    height: 150px;
    margin-bottom: 6px;
  }

  .hobby-description {
    font-size: 3.5vw;
  }
}
