/* Basic Reset */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Lucida Grande", "Lucida Sans Unicode", Helvetica, Arial, sans-serif;
  color: #000;
  background: #c7c7c7;
}

.skip-link {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 8px;
  top: 8px;
  width: auto;
  height: auto;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid #000;
  box-shadow: 1px 1px 0 #fff, 2px 2px 0 #000;
  z-index: 2000;
}

body.ios-mode {
  background: #cfd6df;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* Global layout vars */
:root {
  --menu-bar-height: 28px;
  --status-bar-height: 26px;
  --ios-dock-height: 88px;
  /* visual height incl. padding/shadow */
}

@media (min-width: 768px) {
  .ios-dock {
    display: none !important;
  }
}

/* Desktop Background: Mac OS X 10.0 Aqua Blue */
#desktop {
  position: relative;
  height: calc(100vh - var(--menu-bar-height));
  background-image: url('../images/wallpapers/OS8_Default.png');
  background-repeat: repeat;
  padding: 12px;
  overflow: hidden;
}

/* CRT monitor effect overlay */
.crt::before,
.crt::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.crt::before {
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0, rgba(255, 255, 255, 0.03) 2px, rgba(0, 0, 0, 0.04) 2px, rgba(0, 0, 0, 0.04) 4px);
  mix-blend-mode: multiply;
}

.crt::after {
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.08) 0%, rgba(0, 0, 0, 0) 60%);
}

.crt {
  filter: saturate(1.05) contrast(1.02);
}

body.ios-mode #desktop {
  display: none !important;
}

body.ios-mode #springboard {
  background: url('../images/wallpapers/mobile-wallpaper.png') top center / cover no-repeat fixed;
}

/* Desktop lower-right credit */
.desktop-credit {
  position: fixed;
  left: 12px;
  bottom: 12px;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.7);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow: 1px 1px 0 #fff;
  padding: 6px 12px;
  border-radius: 6px;
  z-index: 900;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

body.ios-mode .desktop-credit {
  display: none;
}

/* Busy overlay removed */

/* Menu Bar */
.menu-bar {
  height: var(--menu-bar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  background: linear-gradient(#f5f5f5, #d7d7d7);
  border-bottom: 1px solid #000;
  position: sticky;
  top: 0;
  z-index: 1000;
  user-select: none;
}

.app-name {
  font-size: 13px;
  margin: 0 6px 0 4px;
  padding: 0 6px;
  border: 1px solid transparent;
}

.menu-left {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

/* Apple dropdown */
.apple-dropdown {
  display: none;
  position: absolute;
  top: 20px;
  left: 0;
  background: #efefef;
  border: 1px solid #000;
  box-shadow: 2px 2px 0 #000;
  list-style: none;
  margin: 0;
  padding: 4px 0;
  z-index: 1002;
}

.apple-dropdown li {
  font-size: 12px;
  padding: 3px 12px;
  white-space: nowrap;
}

.apple-dropdown .separator {
  height: 1px;
  margin: 4px 0;
  background: #9a9a9a;
  padding: 0;
}

body.ios-mode .menu-bar {
  display: none;
}

/* iOS-like Status Bar */
.status-bar {
  display: none;
  height: var(--status-bar-height);
  padding: 3px 10px;
  font-size: 13px;
  background: transparent;
  color: #fff;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  padding-top: calc(3px + env(safe-area-inset-top, 0px));
}

body.ios-mode .status-bar {
  display: flex;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-carrier {
  font-weight: 600;
}

.status-wifi svg {
  display: block;
}

.battery-icon {
  display: inline-block;
  width: 16px;
  height: 9px;
  border: 1px solid #fff;
  background: #fff;
  position: relative;
  top: 1px;
  margin-right: 2px;
  border-radius: 1px;
}

.battery-icon::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 1px;
  width: 2px;
  height: 5px;
  background: #fff;
}

.status-battery {
  font-variant-numeric: tabular-nums;
}

.menu-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-right {
  font-size: 13px;
}

.menu-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-weather {
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  text-decoration: none;
  color: #000;
}

.lang-switcher {
  position: relative;
}

.lang-btn {
  height: calc(var(--menu-bar-height) - 6px);
  padding: 0 8px;
  font-size: 12px;
  border: 1px solid #000;
  background: #e9e9e9;
}

.lang-dropdown {
  top: var(--menu-bar-height);
  right: 0;
  left: auto;
}

.apple-menu {
  background: transparent;
  border: none;
  padding: 0 6px;
  cursor: default;
}

.apple-logo {
  display: block;
}

.menus {
  display: flex;
  align-items: stretch;
  gap: 2px;
}

.menu {
  position: relative;
}

.menu-trigger {
  height: calc(var(--menu-bar-height) - 4px);
  padding: 0 6px;
  font-size: 13px;
  border: 1px solid transparent;
  background: transparent;
  cursor: default;
}

.menu-trigger:focus {
  outline: 1px dotted #000;
}

.menu.open .menu-trigger {
  border-color: #000;
  background: #bfbfbf;
  box-shadow: inset 1px 1px 0 #fff;
}

.menu-dropdown {
  position: absolute;
  top: var(--menu-bar-height);
  left: 0;
  min-width: 160px;
  background: #dfdfdf;
  border: 1px solid #000;
  box-shadow: 2px 2px 0 #000;
  padding: 4px 0;
  list-style: none;
  margin: 0;
  display: none;
  z-index: 1001;
}

.menu.open .menu-dropdown {
  display: block;
}

.menu-dropdown li {
  font-size: 12px;
  padding: 3px 12px;
  white-space: nowrap;
}

.menu-dropdown li:hover {
  background: #bfbfbf;
}

.menu-dropdown .separator {
  height: 1px;
  margin: 4px 0;
  background: #9a9a9a;
  padding: 0;
}

/* Desktop Icons */
.desktop-icons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 16px;
  align-content: start;
  justify-content: end;
}

@media (min-width: 700px) {
  .desktop-icons {
    display: flex;
    flex-direction: column;
    /* stack vertically */
    flex-wrap: wrap;
    /* wrap into columns */
    height: 100%;
    /* fill desktop height to enable column wrap */
    align-content: flex-end;
    /* keep columns aligned to the right */
    justify-content: flex-start;
    /* start at top */
    gap: 18px;
  }
}

.desktop-icon {
  width: 84px;
  text-align: center;
  color: #000;
  cursor: default;
}

.desktop-icon .icon-svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 4px;
  filter: drop-shadow(1px 1px 0 #fff) drop-shadow(-1px -1px 0 #777);
}

.desktop-icon .icon-svg i {
  font-size: 44px;
  color: #000;
  line-height: 48px;
}

/* Ensure desktop image icons fit properly */
.desktop-icon .icon-svg img {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.desktop-icon .icon-label {
  display: inline-block;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.6);
  padding: 1px 4px;
  border: 1px solid #9a9a9a;
}

body.ios-mode .desktop-icon .icon-label {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 6px;
  border-color: rgba(0, 0, 0, 0.2);
}

.desktop-icon:focus .icon-label,
.desktop-icon.selected .icon-label {
  outline: 1px dotted #000;
  background: #bfbfbf;
}

.desktop-icon a.icon-link {
  color: inherit;
  text-decoration: none;
  display: inline-block;
}

/* Beachball hover cursor removed */

/* Mac Window */
.mac-window {
  position: absolute;
  top: 96px;
  left: 96px;
  width: 640px;
  height: 420px;
  background: #fff;
  border: 1px solid #000;
  box-shadow: 1px 1px 0 #fff, 2px 2px 0 #000;
  display: grid;
  grid-template-rows: 22px 1fr;
}

.mac-window.platinum .title-bar {
  background: linear-gradient(#e7e7e7, #cfcfcf);
}

.mac-window.active.platinum .title-bar {
  background: linear-gradient(#4a77ff, #2f5ef4);
  color: #fff;
}

body.ios-mode .mac-window {
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.6);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.mac-window[hidden] {
  display: none !important;
}

.mac-window.active .title-bar {
  background: linear-gradient(#2d63f0, #1745d8);
  color: #fff;
}

.mac-window.inactive .title-bar {
  background: linear-gradient(#e1e1e1, #c9c9c9);
  color: #000;
}

.title-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 68px;
  /* room for controls on the left */
  border-bottom: 1px solid #000;
  user-select: none;
  cursor: move;
}

.title-bar .title {
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
}

/* Aqua pinstripes overlay */
.title-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.25) 0px, rgba(255, 255, 255, 0.25) 2px, rgba(0, 0, 0, 0.04) 2px, rgba(0, 0, 0, 0.04) 4px);
  pointer-events: none;
  opacity: 0.6;
}

body.ios-mode .title-bar {
  border-bottom-color: rgba(0, 0, 0, 0.2);
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.mac-window.active.ios-header .title-bar {
  background: linear-gradient(#5c8bff, #3f6af1);
}

.title-bar .title {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}

.controls {
  position: absolute;
  left: 7px;
  top: 3px;
  display: flex;
  gap: 7px;
}

.control {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.6);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.2)),
    linear-gradient(#d0d0d0, #b6b6b6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  padding: 0;
  cursor: default;
  position: relative;
}

.control::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.control.close {
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.15)), linear-gradient(#ff6b63, #d9332a);
}

.control.minimize {
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.15)), linear-gradient(#ffd86b, #dea81f);
}

.control.zoom {
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.15)), linear-gradient(#6bff7d, #18b243);
}

.controls:hover .control::after {
  color: rgba(0, 0, 0, 0.8);
  font-size: 10px;
  line-height: 14px;
  text-align: center;
  position: absolute;
  inset: 0;
}

.controls:hover .control.close::after {
  content: "×";
}

.controls:hover .control.minimize::after {
  content: "–";
}

.controls:hover .control.zoom::after {
  content: "+";
}

.window-content {
  padding: 10px;
  overflow: auto;
  font-size: 14px;
}

/* Retro group boxes and lists */
.group-box {
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #fff;
  padding: 12px;
  margin-bottom: 10px;
  background: #f9f9f9;
}

/* Experience list (Resume) */
.experience-list {
  display: grid;
  gap: 10px;
}

.experience-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  align-items: center;
  padding: 6px;
  background: #f2f2f2;
  border: 1px solid #000;
}

.experience-logo {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #bcbcbc;
  padding: 4px;
}

.experience-meta {
  display: grid;
  gap: 2px;
}

.experience-title {
  font-weight: 700;
}

.experience-company {
  color: #333;
}

.experience-dates,
.experience-location {
  color: #555;
  font-size: 12px;
}

/* Projects list */
.project-list {
  display: grid;
  gap: 10px;
  padding-bottom: 12px;
}

/* Carousel slide image styles */
.project-carousel-item img:not(.project-carousel-logo) {
  display: block;
  height: auto;
  width: 180px;
  background: #fff;
  box-shadow: 1px 1px 0 #fff;
}

.project-carousel-logo {
  display: none;
}

.project-carousel-item[data-target] {
  cursor: pointer;
}

.project-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  background: #fff;
  border: 1px solid #000;
  box-shadow: 1px 1px 0 #fff;
  align-items: start;
  transition: box-shadow 0.4s cubic-bezier(.4, 0, .2, 1);
}

.project-item.highlight {
  /* Animated, blurred, colored (hue) box-shadow */
  box-shadow:
    0 0 0 0 #fff,
    0 0 12px 8px #4f8cff88;
  /* fallback for browsers that don't support transition on box-shadow */
  animation: highlight-glow 0.4s cubic-bezier(.4, 0, .2, 1);
}

@keyframes highlight-glow {
  from {
    box-shadow:
      1px 1px 0 #fff,
      0 0 0 0 #4f8cff00;
  }

  to {
    box-shadow:
      1px 1px 0 #fff,
      0 0 12px 8px #4f8cff88;
  }
}

/* Row containing logo (left) and description (right) */
.project-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Ensure the header row spans both columns on desktop */


.project-row .project-title {
  flex: 0 0 76px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-row .project-description {
  flex: 1 1 260px;
}

.project-row .project-description i {
  text-decoration: line-through;
}

.project-title {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Square logo box */
.project-logo-box {
  width: 76px;
  height: 76px;
  border: 1px solid #bcbcbc;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-logo {
  display: block;
  max-width: 80%;
  max-height: 80%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.project-description {
  margin: 2px 0 8px 0;
}

.project-responsibilities {
  display: grid;
  gap: 8px;
  margin-bottom: 6px;
}

.project-responsibility-title {
  font-weight: 700;
}

.project-responsibility-description p {
  margin: 4px 0;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* Flex layout: header row first, then stacks */

.project-tag {
  font-size: 11px;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #fff;
  padding: 2px 6px;
  background: #eaeaea;
}

.project-link-text {
  display: inline-block;
  font-size: 11px;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #fff;
  padding: 2px 6px;
  background: #eaeaea;
  color: #000;
  text-decoration: none;
}

.project-link-text:hover {
  background: #dedede;
  text-decoration: none;
}

/* iOS 7 styling for project links */
body.ios-mode .project-link-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #111;
  background: #f2f2f7;
  border: 1px solid rgba(60, 60, 67, 0.16);
  box-shadow: none;
  border-radius: 12px;
  padding: 2px 8px;
}
body.ios-mode .project-link-text:hover { background: #eaeaef; }

@media (max-width: 560px) {
  .project-row .project-title {
    flex-basis: 76px;
  }

  .project-title {
    justify-content: flex-start;
  }

  /* no grid specific overrides needed */
}

/* Snake game */
.snake-game {
  display: grid;
  gap: 10px;
  place-items: center;
}

.snake-hud {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

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

.snake-canvas {
  image-rendering: pixelated;
  border: 1px solid #000;
  background: #111;
}

.snake-controls {
  display: none;
}

body.ios-mode .snake-controls {
  display: grid;
  gap: 6px;
}

.snake-controls .ctrl-row {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.group-title {
  display: inline-block;
  margin-top: 0;
  margin-left: 0;
  background: #f9f9f9;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.lede {
  font-weight: 600;
  margin-top: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

.chips li {
  font-size: 11px;
  border: 1px solid #000;
  padding: 2px 6px;
  background: #eaeaea;
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin: 8px 0 12px;
  width: 100%;
}

.folder-tile {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 10px;
  border: 1px solid #000;
  box-shadow: 1px 1px 0 #fff, 2px 2px 0 #000;
  text-decoration: none;
  color: #000;
  background: #f3f3f3;
}

.folder-tile:hover {
  background: #e3e3e3;
}

.folder-icon {
  width: 64px;
  height: 42px;
  background: linear-gradient(#fff, #dfe3ff);
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #fff;
  border-radius: 6px 6px 2px 2px;
  display: flex;
  align-content: center;
  justify-content: center;
}

.folder-icon img {
  /* height: 18px;
  width: fit-content; */
  align-self: center;
}

.folder-label {
  font-size: 12px;
}

.link-list {
  display: grid;
  gap: 6px;
  padding-bottom: 12px;
}

.link-row {
  display: grid;
  grid-template-columns: 60% 40%;
  padding: 6px 8px;
  border: 1px solid #000;
  box-shadow: 1px 1px 0 #fff;
  background: #fff;
  color: #0645ad;
  text-decoration: none;
  gap: 8px;
}

@media (min-width: 768px) {
  .link-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}

.link-row:hover {
  background: #f3f6ff;
}

.link-title {
  font-size: 13px;
}

.link-meta {
  font-size: 11px;
  color: #333;
}

.button-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.retro-button {
  display: inline-block;
  border: 1px solid #000;
  background: linear-gradient(#fff, #e9e9e9);
  box-shadow: 1px 1px 0 #fff, 2px 2px 0 #000;
  padding: 4px 10px;
  font-size: 12px;
  color: #000;
  text-decoration: none;
}

.retro-button:hover {
  background: linear-gradient(#fff, #dcdcdc);
}

body.ios-mode .window-content {
  padding: 12px;
  padding-bottom: 112px;
  font-size: 15px;
}

.resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, transparent 50%, #000 50%);
  cursor: nwse-resize;
}

body.ios-mode .resize-handle {
  display: none;
}

/* Hide desktop chrome in iOS mode; show SpringBoard */
body.ios-mode .mac-window,
body.ios-mode .desktop-icons {
  display: none !important;
}

body.ios-mode #springboard {
  display: grid;
}

body.ios-mode .home-button {
  display: block;
}

body.ios-mode .dock {
  display: none !important;
}

/* Improved Dock - ensure hidden on desktop */
.dock {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.dock .dock-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  position: relative;
  transform-origin: bottom center;
  transition: transform 0.08s linear;
  cursor: default;
}

.dock .dock-icon img,
.dock .dock-icon svg,
.dock .dock-icon i {
  width: 36px;
  height: 36px;
  font-size: 32px;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.6));
}

.dock .label {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.dock .dock-icon:hover .label {
  opacity: 1;
}

.dock .indicator {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid rgba(0, 0, 0, 0.8);
  opacity: 0;
  transition: opacity 0.2s;
}

.dock .dock-icon.active .indicator {
  opacity: 1;
}

@keyframes bounce {
  0% {
    transform: translateY(0) scale(var(--mag, 1));
  }

  30% {
    transform: translateY(-12px) scale(var(--mag, 1));
  }

  60% {
    transform: translateY(0) scale(var(--mag, 1));
  }

  80% {
    transform: translateY(-6px) scale(var(--mag, 1));
  }

  100% {
    transform: translateY(0) scale(var(--mag, 1));
  }
}

.dock .dock-icon.bounce {
  animation: bounce 0.6s ease-out;
}

body.ios-mode .dock {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 10px;
}

/* SpringBoard paging */
.sb-pages {
  height: calc(100% - var(--ios-dock-height) - 18px);
  overflow: hidden;
  position: relative;
}

.sb-pages .sb-page {
  position: absolute;
  inset: 0;
}

.page-dots {
  position: absolute;
  bottom: calc(var(--ios-dock-height) - 6px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.page-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

.page-dots span.active {
  background: #fff;
}

/* Aqua scrollbars approximation */
* {
  scrollbar-width: thin;
  scrollbar-color: #9fb7ff #e6ecff;
}

*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  background: linear-gradient(#f3f6ff, #dde7ff);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(#b7c8ff, #8aa6ff);
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* App name highlight when active window changes */
.app-name {
  transition: background-color 120ms ease, color 120ms ease;
}

.app-name.active {
  background: #3466ff;
  color: #fff;
  border-color: #123aa8;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.7);
}

/* Boot overlay removed */

/* iOS mode layout and visuals (iOS 4-inspired) */
body.ios-mode {
  background:
    radial-gradient(1200px 800px at 50% -20%, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0) 60%),
    linear-gradient(180deg, #2a3d59, #0e1623 60%, #0a0f18);
}

body.ios-mode #springboard {
  position: fixed;
  top: var(--status-bar-height);
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + var(--ios-dock-height) + 10px) 12px;
}

.springboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 10px;
  justify-items: center;
  align-content: start;
}

.sb-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 40%),
    radial-gradient(120px 80px at 50% -20%, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 45%),
    linear-gradient(180deg, #5b7bb6, #2b4a84 50%, #1a2f56);
  border: none;
  display: grid;
  place-items: center;
  padding: 0;
}

.sb-icon i {
  color: #fff;
  font-size: 28px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.8);
}

/* Ensure image-based icons fit inside iOS icons */
.sb-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sb-icon:active {
  transform: scale(0.96);
}

.sb-label {
  margin-top: 6px;
  font-size: 12px;
  color: #fff;
  text-shadow: 0px 0px 3px rgba(0, 0, 0, 0.8);
  text-align: center;
}

/* iOS Dock (shelf) */
.ios-dock {
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: fit-content;
  padding: 18px 0 10px 0;
  gap: 16px;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.28);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 -0.5px 0 rgba(60, 60, 67, 0.1) inset, 0 8px 20px rgba(0, 0, 0, 0.18);
  border-radius: 0;
  z-index: 1500;
}

.ios-dock .sb-icon {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: unset;
  /* reverted to original minimal styling */
}

/* Dock items stack icon above label (iOS 4 style) */
.ios-dock-item {
  display: grid;
  grid-template-rows: 58px auto;
  justify-items: center;
  align-items: end;
}

.ios-dock-item .sb-label {
  margin-top: 6px;
  font-size: 11px;
  color: #fff;
  text-shadow: 0px 0px 3px rgba(0, 0, 0, 0.8);
}

.ios-dock .sb-icon img {
  width: 100%;
  height: 100%;
}

/* Dock visible on both desktop and mobile */

/* Ensure mac dock stays hidden in iOS mode, use iOS dock instead */
body.ios-mode .dock {
  display: none !important;
}

/* iOS apps container fills screen below status bar */
body.ios-mode .ios-app {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--status-bar-height);
  bottom: 0;
  background: #f6f7f9;
  overflow: auto;
}

/* iOS 7-style app header */
.ios-app .ios-nav {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  z-index: 2;
}

.ios-app .ios-back {
  position: absolute;
  left: 8px;
  top: 7px;
  height: 30px;
  padding: 0 8px 0 6px;
  font-size: 14px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #007aff;
}

.ios-app .ios-back::before {
  content: '‹';
  font-size: 22px;
  line-height: 0;
  position: relative;
  top: 1px;
  margin-right: 4px;
}

.ios-app .ios-back:active {
  opacity: 0.6;
}

.ios-app .ios-title {
  font-weight: 600;
  font-size: 16px;
  color: #111;
}

/* Mobile window content spacing */
body.ios-mode .ios-app {
  background: rgba(249, 249, 249, 1);
}

body.ios-mode .ios-app .app-body {
  padding: 0;
}

/* iOS 7 visual language: softer borders and shadows on mobile */
body.ios-mode .group-box,
body.ios-mode .project-item {
  border: 1px solid rgba(60, 60, 67, 0.16);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
}
/* Modernize experience items only on mobile/iOS */
body.ios-mode .experience-item {
  padding: 10px;
  background: #fff;
  border: 1px solid rgba(60, 60, 67, 0.16);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
body.ios-mode .experience-logo {
  border: 1px solid rgba(60, 60, 67, 0.18);
  border-radius: 10px;
}

body.ios-mode .project-logo-box {
  border-color: rgba(60, 60, 67, 0.18);
  background: #fff;
  border-radius: 10px;
}

body.ios-mode .project-tag,
body.ios-mode .chips li {
  border: 1px solid rgba(60, 60, 67, 0.16);
  background: #f2f2f7;
  border-radius: 12px;
}

/* Links and list rows */
body.ios-mode .link-row {
  border: 1px solid rgba(60, 60, 67, 0.16);
  box-shadow: none;
  background: #fff;
}
body.ios-mode .link-row:hover { background: #f7f7fb; }

/* Buttons (within iOS apps) */
.ios-app .retro-button {
  border: 1px solid rgba(0, 122, 255, 0.28);
  background: rgba(0, 122, 255, 0.08);
  color: #007aff;
  border-radius: 10px;
}
.ios-app .retro-button:hover { background: rgba(0, 122, 255, 0.14); }

/* Inputs inside iOS apps */
.ios-app input[type="text"],
.ios-app input[type="email"],
.ios-app input[type="tel"],
.ios-app input[type="number"],
.ios-app textarea {
  border: 1px solid rgba(60, 60, 67, 0.2) !important;
  box-shadow: none !important;
  background: #fff !important;
}

body:not(.ios-mode) .about {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: flex-start;
}

@media screen and (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
}

@media screen and (min-width: 768px) {
  .mobile-only {
    display: none !important;
  }
}

body.ios-mode .desktop-only {
  display: none !important;
}

body.ios-mode .about {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  justify-content: flex-start;
}

.about-text-inner p {
  margin: 0;
}

body.ios-mode .about-text-inner {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}

body:not(.ios-mode) .mobile-only {
  display: none;
}

.mobile-credit {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}

.about-mac-logo {
  margin-bottom: 10px;
}

.video-item {
  display: grid;
  grid-template-columns: 60% 40%;
  gap: 12px;
  padding-right: 12px;
  align-items: start;
}

.video-item video {
  width: 100%;
  height: auto;
  display: block;
  background: #000;
  border: 1px solid #000;
  box-shadow: 1px 1px 0 #fff;
  cursor: pointer;
}

.video-description {
  display: grid;
  gap: 6px;
}

.video-description-text p {
  margin: 4px 0;
}

@media (max-width: 700px) {
  .video-item {
    grid-template-columns: 1fr;
  }
}

.form-label {
  margin-bottom: 8px;
}

.avatar.mobile-only {
  border-radius: 12px;
}

.project-carousel-wrapper {
  overflow: hidden;
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .project-carousel-wrapper {
    border-radius: 12px;
  }
}