* {
  margin: 0;
  padding: 0;
  image-rendering: auto;
}

/* ============ Theme variables ============ */
:root,
body.theme-dark {
  --dock-bg: rgba(83, 83, 83, 0.25);
  --dock-border: rgba(255, 255, 255, 0.18);
  --tooltip-bg: rgba(0, 0, 0, 0.5);
  --tooltip-text: rgba(255, 255, 255, 0.9);
  --window-bg: rgba(38, 38, 40, 0.72);
  --window-border: rgba(255, 255, 255, 0.12);
  --titlebar-bg: rgba(60, 60, 62, 0.5);
  --titlebar-border: rgba(255, 255, 255, 0.08);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.92);
  --text-muted: rgba(255, 255, 255, 0.78);
  --text-faint: rgba(255, 255, 255, 0.5);
  --scrollbar-thumb: rgba(255, 255, 255, 0.15);
  --card-bg: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.08);
  --pill-bg: rgba(255, 255, 255, 0.1);
  --pill-border: rgba(255, 255, 255, 0.1);
  --link-bg: rgba(255, 255, 255, 0.12);
  --link-border: rgba(255, 255, 255, 0.15);
  --link-hover-bg: rgba(255, 255, 255, 0.22);
  --accent: #0a84ff;
  --accent-hover: #2b95ff;
  --shadow: 0 25px 60px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.theme-light {
  --dock-bg: rgba(255, 255, 255, 0.45);
  --dock-border: rgba(0, 0, 0, 0.1);
  --tooltip-bg: rgba(255, 255, 255, 0.85);
  --tooltip-text: rgba(0, 0, 0, 0.85);
  --window-bg: rgba(246, 246, 248, 0.82);
  --window-border: rgba(0, 0, 0, 0.08);
  --titlebar-bg: rgba(255, 255, 255, 0.6);
  --titlebar-border: rgba(0, 0, 0, 0.06);
  --text-primary: #1c1c1e;
  --text-secondary: rgba(28, 28, 30, 0.92);
  --text-muted: rgba(28, 28, 30, 0.68);
  --text-faint: rgba(28, 28, 30, 0.5);
  --scrollbar-thumb: rgba(0, 0, 0, 0.15);
  --card-bg: rgba(0, 0, 0, 0.04);
  --card-border: rgba(0, 0, 0, 0.07);
  --pill-bg: rgba(0, 0, 0, 0.06);
  --pill-border: rgba(0, 0, 0, 0.08);
  --link-bg: rgba(0, 0, 0, 0.06);
  --link-border: rgba(0, 0, 0, 0.1);
  --link-hover-bg: rgba(0, 0, 0, 0.1);
  --accent: #0a84ff;
  --accent-hover: #2b95ff;
  --shadow: 0 25px 60px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
}

body.theme-red {
  --dock-bg: rgba(60, 12, 12, 0.35);
  --dock-border: rgba(255, 190, 170, 0.22);
  --tooltip-bg: rgba(40, 6, 6, 0.7);
  --tooltip-text: rgba(255, 235, 225, 0.92);
  --window-bg: rgba(48, 12, 12, 0.75);
  --window-border: rgba(255, 150, 120, 0.16);
  --titlebar-bg: rgba(90, 20, 18, 0.55);
  --titlebar-border: rgba(255, 150, 120, 0.12);
  --text-primary: #fff3ee;
  --text-secondary: rgba(255, 240, 232, 0.92);
  --text-muted: rgba(255, 225, 212, 0.78);
  --text-faint: rgba(255, 210, 195, 0.55);
  --scrollbar-thumb: rgba(255, 150, 120, 0.2);
  --card-bg: rgba(255, 110, 80, 0.08);
  --card-border: rgba(255, 150, 120, 0.14);
  --pill-bg: rgba(255, 110, 80, 0.12);
  --pill-border: rgba(255, 150, 120, 0.14);
  --link-bg: rgba(255, 110, 80, 0.15);
  --link-border: rgba(255, 150, 120, 0.2);
  --link-hover-bg: rgba(255, 110, 80, 0.26);
  --accent: #ff5a3c;
  --accent-hover: #ff7a5c;
  --shadow: 0 25px 60px rgba(20, 0, 0, 0.55), 0 2px 8px rgba(20, 0, 0, 0.3);
}

/* ============ Wallpapers (tied to theme) ============ */
body.theme-dark {
  background-image: url(../img/wallpapers/dark.jpg);
}

body.theme-light {
  background-image: url(../img/wallpapers/light.jpg);
}

body.theme-red {
  background-image: url(../img/wallpapers/red.jpg);
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Ubuntu Sans", -apple-system, BlinkMacSystemFont, sans-serif;
}

@font-face {
  font-family: "Ubuntu Sans";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 75% 100%;
  src: url("../fonts/UbuntuSans-Variable.ttf");
}

@font-face {
  font-family: "Ubuntu Sans";
  font-style: italic;
  font-weight: 100 900;
  font-stretch: 75% 100%;
  src: url("../fonts/UbuntuSans-Italic-Variable.ttf");
}

body {
  image-rendering: pixelated;
  background-size: cover;
  background-position: center;
  transition: background-color 0.2s ease;
}

.dock {
  width: auto;
  height: 60px;
  border-radius: 16px;
  display: flex;
  justify-content: center;
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
}

.dock .dock-container {
  padding: 3px;
  width: auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--dock-bg);
  backdrop-filter: blur(13px);
  -webkit-backdrop-filter: blur(13px);
  border: 1px solid var(--dock-border);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.dock .dock-container li {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  vertical-align: bottom;
  transition: 0.2s;
  transform-origin: 50% 100%;
}

.dock .dock-container li:hover {
  margin: 0px 13px 0px 13px;
}

.dock .dock-container li .name {
  position: absolute;
  top: -70px;
  background: var(--tooltip-bg);
  color: var(--tooltip-text);
  height: 10px;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  visibility: hidden;
}

.dock .dock-container li .name::after {
  content: "";
  position: absolute;
  bottom: -10px;
  width: 0;
  height: 0;
  backdrop-filter: blur(13px);
  -webkit-backdrop-filter: blur(13px);
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid var(--tooltip-bg);
}

.dock .dock-container li .ico {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.2s;
  display: inline-block;
  transition: transform 0.3s ease;
}

.dock .dock-container li:hover .name {
  visibility: visible !important;
}

/* ============ Windows ============ */
.windows-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  pointer-events: none;
}

.window {
  position: absolute;
  width: 620px;
  max-width: 90vw;
  min-width: 320px;
  min-height: 200px;
  max-height: 82vh;
  border-radius: 12px;
  overflow: hidden;
  background: var(--window-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--window-border);
  box-shadow: var(--shadow);
  pointer-events: auto;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  opacity: 0;
  transform: scale(0.85) translateY(20px);
  transition: opacity 0.28s cubic-bezier(.2, .9, .3, 1.2), transform 0.28s cubic-bezier(.2, .9, .3, 1.2);
  display: flex;
  flex-direction: column;
}

.window.open {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.window.closing {
  opacity: 0;
  transform: scale(0.85) translateY(20px);
}

.window.minimized {
  opacity: 0;
  transform: scale(0.15) translate(-40vw, 45vh);
  pointer-events: none;
}

.window-titlebar {
  height: 38px;
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--titlebar-bg);
  border-bottom: 1px solid var(--titlebar-border);
  cursor: grab;
  user-select: none;
}

.window-titlebar:active {
  cursor: grabbing;
}

.traffic-lights {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 12px;
}

.traffic-lights span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.15);
  cursor: pointer;
  position: relative;
}

.tl-close {
  background: #ff5f57;
}

.tl-min {
  background: #febc2e;
}

.tl-zoom {
  background: #28c840;
}

.traffic-lights span:hover::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.15);
}

.window-title {
  flex: 1;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  margin-right: 60px;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window-body {
  flex: 1 1 auto;
  overflow-y: auto;
  color: var(--text-secondary);
  font-family: "Ubuntu Sans", -apple-system, BlinkMacSystemFont, sans-serif;
}

.window-body::-webkit-scrollbar {
  width: 8px;
}

.window-body::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}

/* Project window content */
.win-banner {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.win-banner img {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.banner-capturespheregen {
  background: radial-gradient(circle at 30% 30%, #4a1414, #1a0a0a 70%);
}

.banner-solace {
  background: radial-gradient(circle at 30% 30%, #1c3a5e, #0a1622 70%);
}

.banner-r04dw4y {
  background: radial-gradient(circle at 30% 30%, #2a1f5e, #120e2b 70%);
}

.win-content {
  padding: 20px 26px 26px;
}

.win-content h1 {
  font-size: 22px;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.win-content .win-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
}

.win-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 16px;
}

.win-tags span {
  font-size: 11px;
  letter-spacing: 0.03em;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--pill-bg);
  color: var(--text-secondary);
  border: 1px solid var(--pill-border);
}

.win-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 22px;
}

.win-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.win-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 8px;
  background: var(--link-bg);
  border: 1px solid var(--link-border);
  transition: background 0.15s ease, transform 0.15s ease;
}

.win-links a:hover {
  background: var(--link-hover-bg);
  transform: translateY(-1px);
}

.win-links a.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.win-links a.primary:hover {
  background: var(--accent-hover);
}

/* About window */
.about-hero {
  padding: 26px 26px 4px;
}

.about-hero .eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 6px;
}

.about-hero h1 {
  font-size: 24px;
  margin: 0 0 10px;
  color: var(--text-primary);
}

.about-hero p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
}

.about-hero p b {
  color: var(--text-primary);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 6px 26px 26px;
}

.about-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 14px;
}

.about-card .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.about-card .value {
  font-size: 13.5px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Skills window */
.skills-section {
  padding: 22px 26px 26px;
}

.skills-section h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin: 18px 0 10px;
}

.skills-section h2:first-child {
  margin-top: 0;
}

.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-pills span {
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 20px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  color: var(--text-secondary);
}

/* Contact window */
.contact-body {
  padding: 30px 26px;
  text-align: center;
}

.contact-body h1 {
  margin: 0 0 8px;
  font-size: 20px;
  color: var(--text-primary);
}

.contact-body p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* dock open-indicator dot */
.app-icon {
  cursor: pointer;
  position: relative;
}

.app-icon.is-open::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-primary);
}

/* ============ Settings window ============ */
.settings-body {
  padding: 22px 26px 26px;
}

.settings-section {
  margin-bottom: 24px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin: 0 0 12px;
}

.theme-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.theme-option {
  flex: 1;
  min-width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 10px 10px;
  border-radius: 10px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.theme-option:hover {
  background: var(--link-hover-bg);
}

.theme-option.active {
  border-color: var(--accent);
}

.theme-swatch {
  width: 100%;
  height: 40px;
  border-radius: 7px;
  border: 1px solid var(--card-border);
  background-size: cover;
  background-position: center;
}

.swatch-dark {
  background-image: url(../img/wallpapers/dark.jpg);
}

.swatch-light {
  background-image: url(../img/wallpapers/light.jpg);
}

.swatch-red {
  background-image: url(../img/wallpapers/red.jpg);
}

.theme-option .theme-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ================================================================
   iOS-style mobile experience
   Desktop stays macOS (dock + floating windows). Below 700px the
   macOS dock is swapped for an iOS home screen + status bar, and
   app windows become full-height sheets that slide up from the
   bottom, like opening an app on an iPhone.
   ================================================================ */

.ios-shell {
  display: none;
}

@media (max-width: 700px) {

  /* ---------- switch chrome: macOS dock out, iOS shell in ---------- */
  .dock {
    display: none;
  }

  .ios-shell {
    display: flex;
    flex-direction: column;
    position: absolute;
    inset: 0;
    z-index: 10;
    transform-origin: center top;
    transition: transform 0.42s cubic-bezier(.32, .72, 0, 1), border-radius 0.42s cubic-bezier(.32, .72, 0, 1), filter 0.42s ease;
  }

  body.sheet-open .ios-shell {
    transform: scale(0.91) translateY(6px);
    border-radius: 34px;
    overflow: hidden;
    filter: brightness(0.65);
  }

  /* ---------- status bar ---------- */
  .status-bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 26px 4px;
    color: var(--text-primary);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  }

  .status-time {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    font-variant-numeric: tabular-nums;
  }

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

  .status-icons svg {
    display: block;
  }

  .icon-signal {
    width: 18px;
    height: 12px;
  }

  .icon-wifi {
    width: 16px;
    height: 12px;
  }

  .icon-battery {
    width: 25px;
    height: 12px;
  }

  .status-battery-pct {
    font-size: 15px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
  }

  #battery-fill {
    transition: width 0.3s ease, fill 0.3s ease;
  }

  .icon-battery.is-charging #battery-fill,
  .status-battery-pct.is-charging {
    fill: #30d158;
    color: #30d158;
  }

  .icon-battery.is-low #battery-fill,
  .status-battery-pct.is-low {
    fill: #ff453a;
    color: #ff453a;
  }

  /* ---------- app icon grid (iOS home screen) ---------- */
  .ios-grid {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px 0;
    align-content: start;
    padding: 34px 22px 0;
    list-style: none;
  }

  .ios-shell .app-icon {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .ios-ico-wrap {
    width: 58px;
    height: 58px;
    border-radius: 15px;
    overflow: hidden;
    display: block;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
    transition: transform 0.12s ease;
  }

  .ios-shell .app-icon:active .ios-ico-wrap {
    transform: scale(0.9);
  }

  .ios-ico {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .ios-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-primary);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    text-align: center;
    max-width: 72px;
    line-height: 1.25;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
  }

  /* ---------- dock (iOS style: frosted pill, no labels) ---------- */
  .ios-dock {
    flex: 0 0 auto;
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 22px;
    margin: 0 16px 10px;
    padding: 12px 26px;
    border-radius: 30px;
    background: var(--dock-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--dock-border);
  }

  .ios-dock .ios-ico-wrap {
    width: 54px;
    height: 54px;
  }

  /* ---------- home indicator ---------- */
  .home-indicator {
    flex: 0 0 auto;
    width: 134px;
    height: 5px;
    border-radius: 3px;
    background: #fff;
    opacity: 0.55;
    margin: 8px auto 8px;
  }

  /* ---------- windows become full-height iOS sheets ---------- */
  .windows-layer {
    z-index: 60;
  }

  .window {
    position: absolute;
    inset: 0;
    top: 46px;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    max-height: none;
    height: calc(100% - 46px);
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    opacity: 1;
    transition: transform 0.42s cubic-bezier(.32, .72, 0, 1);
  }

  .window.open {
    transform: translateY(0);
  }

  .window.closing {
    transform: translateY(100%);
  }

  .window.minimized,
  .window.maximized {
    transform: translateY(0);
    inset: 0;
    top: 46px;
    height: calc(100% - 46px);
  }

  /* ---------- iOS nav bar (replaces macOS titlebar) ---------- */
  .ios-navbar {
    flex: 0 0 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--titlebar-bg);
    border-bottom: 1px solid var(--titlebar-border);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
  }

  .ios-grabber {
    width: 36px;
    height: 5px;
    border-radius: 3px;
    background: var(--text-faint);
    opacity: 0.6;
    margin: 8px 0 4px;
  }

  .ios-navbar-row {
    width: 100%;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr);
    align-items: center;
    padding: 6px 16px 12px;
  }

  .ios-navbar-title {
    grid-column: 2;
    min-width: 0;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ios-done {
    grid-column: 3;
    justify-self: end;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 16px;
    font-weight: 600;
    padding: 4px 0 4px 12px;
    cursor: pointer;
    font-family: inherit;
  }

  .ios-done:active {
    opacity: 0.5;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }
}