/* ==========================================================================
   Daniel OS — desktop-style portfolio (experiment)
   ========================================================================== */
html,
body.os {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body.os {
  --menubar: 30px;
  font-family: var(--font-body);
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

.os input,
.os textarea {
  user-select: text;
  -webkit-user-select: text;
}

/* The site soundtrack button is controlled from the menu bar and dock here */
.os .audio-dock {
  display: none;
}

/* ---------- Wallpaper ---------- */
.os-wallpaper {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 60% at 30% 25%, #262626 0%, transparent 60%),
    radial-gradient(ellipse 60% 70% at 80% 80%, #1c1c1c 0%, transparent 60%),
    #0a0a0a;
}

.os-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  animation: blob-morph 18s ease-in-out infinite alternate, blob-drift 26s ease-in-out infinite alternate;
}

.os-blob-a {
  top: -10vmax;
  left: -8vmax;
  width: 52vmax;
  height: 52vmax;
  background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.14), transparent 65%);
}

.os-blob-b {
  right: -12vmax;
  bottom: -14vmax;
  width: 60vmax;
  height: 60vmax;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.09), transparent 62%);
  animation-direction: alternate-reverse;
}

.os-wallpaper-mark {
  position: absolute;
  right: 4vw;
  bottom: 12vh;
  color: transparent;
  font-family: var(--font-display);
  font-size: clamp(8rem, 26vw, 26rem);
  font-weight: 900;
  font-stretch: 112%;
  letter-spacing: -0.06em;
  line-height: 0.8;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.06);
}

/* ---------- Menu bar ---------- */
.os-menubar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--menubar);
  padding: 0 14px;
  background: rgba(20, 20, 20, 0.55);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #f2f2f0;
  font-size: 0.82rem;
}

.os-menu-left,
.os-menu-right {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.os-menu-logo img {
  width: auto;
  height: 15px;
}

.os-menu-brand {
  font-weight: 700;
}

.os-menu-app {
  font-weight: 600;
}

.os-menu-item {
  color: rgba(242, 242, 240, 0.82);
}

.os-menu-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.os-menu-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.os-menu-icon .fill {
  fill: currentColor;
  stroke: none;
}

.os-menu-sound {
  display: grid;
  place-items: center;
  height: 22px;
  padding: 0 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
}

.os-menu-sound:hover {
  background: rgba(255, 255, 255, 0.12);
}

.os-menu-sound.is-playing .music-bars i {
  animation: eq 0.9s ease-in-out infinite alternate;
}

.os-menu-clock {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Desktop ---------- */
.os-desktop {
  position: fixed;
  inset: var(--menubar) 0 0 0;
  z-index: 1;
}

.os-hello {
  position: absolute;
  top: clamp(40px, 12vh, 120px);
  left: clamp(20px, 6vw, 96px);
  display: grid;
  gap: 16px;
  max-width: 760px;
  color: #f2f2f0;
  pointer-events: none;
}

.os-hello-kicker {
  color: rgba(242, 242, 240, 0.55);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.os-hello-title {
  color: #f6f6f4;
  font-size: clamp(2.8rem, 8vw, 7rem);
  font-weight: 900;
  font-stretch: 110%;
  line-height: 0.88;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.os-hello-role {
  color: #f2f2f0;
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.8vw, 1.4rem);
  font-weight: 700;
}

.os-hello-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  color: rgba(242, 242, 240, 0.6);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Desktop folders (right column, like a real desktop) */
.os-icons {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.os-icon {
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 104px;
  padding: 8px 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #f2f2f0;
  text-align: center;
}

.os-icon-art svg {
  width: 62px;
  height: 50px;
}

.os-icon-art .back {
  fill: #6f6f6c;
}

.os-icon-art .front {
  fill: #c9c9c5;
}

.os-icon-label {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.os-icon:hover {
  background: rgba(255, 255, 255, 0.08);
}

.os-icon.is-selected {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.18);
}

.os-icon.is-selected .os-icon-label {
  background: #f2f2f0;
  color: #0b0b0b;
  text-shadow: none;
}

/* ---------- Windows ---------- */
.os-windows {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.os-window {
  position: fixed;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(22, 22, 22, 0.92);
  backdrop-filter: blur(30px) saturate(1.4);
  -webkit-backdrop-filter: blur(30px) saturate(1.4);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6), 0 0 0 0.5px rgba(0, 0, 0, 0.8);
  color: #e9e9e6;
  visibility: hidden;
  pointer-events: auto;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}

.os-titlebar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(34, 34, 34, 0.9);
}

.os-titlebar h2 {
  overflow: hidden;
  color: #d9d9d5;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.os-lights {
  position: absolute;
  left: 14px;
  display: flex;
  gap: 8px;
}

.os-light {
  display: block;
  width: 12px;
  height: 12px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #4a4a48;
}

/* monochrome "traffic lights": the close button lights up on hover */
.os-light-close {
  cursor: pointer;
  background: #8a8a87;
}

.os-light-close:hover {
  background: #f2f2f0;
}

.os-window-body {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.os-meta {
  margin: 4px 0 12px;
  color: #8f8f8b;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.os-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.os-thumb {
  display: block;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #111111;
  cursor: zoom-in;
  aspect-ratio: 4 / 5;
}

.os-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.os-thumb:hover img {
  transform: scale(1.06);
}

.os-grid-video {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.os-grid-video video {
  width: 100%;
  border-radius: 8px;
  background: #000;
}

/* AI video player window */
.os-window-folder .os-player {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.os-player-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: #000;
  object-fit: contain;
}

.os-player-info {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.os-player-info strong {
  color: #f6f6f4;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
}

.os-player-info span {
  color: #8f8f8b;
  font-size: 0.86rem;
}

.os-playlist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.os-track {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  text-align: left;
}

.os-track img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
}

.os-track span {
  display: grid;
  gap: 2px;
}

.os-track strong {
  font-size: 0.84rem;
}

.os-track em {
  color: #8f8f8b;
  font-size: 0.74rem;
  font-style: normal;
}

.os-track:hover,
.os-track.is-active {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

/* Logos */
.os-logos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.os-logo-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.os-logo-mark {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  background: #e8e8e4;
}

.os-logo-mark img {
  width: 60%;
  height: 70%;
  object-fit: contain;
}

.os-logo-board {
  aspect-ratio: 16 / 10;
}

.os-logo-card p {
  display: grid;
}

.os-logo-card strong {
  color: #f6f6f4;
}

.os-logo-card span {
  color: #8f8f8b;
  font-size: 0.8rem;
}

/* Notes (About) */
.os-window-notes {
  background: rgba(244, 244, 240, 0.97);
  color: #1d1d1b;
}

.os-window-notes .os-titlebar {
  background: rgba(232, 232, 228, 0.95);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.os-window-notes .os-titlebar h2 {
  color: #3b3b39;
}

.os-doc {
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 8px 30px;
  user-select: text;
}

.os-doc-date {
  color: #8a8a86;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.os-doc h3 {
  margin: 10px 0 6px;
  color: #111110;
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  font-weight: 900;
  line-height: 0.95;
}

.os-doc-lead {
  margin-bottom: 18px;
  color: #111110;
  font-weight: 700;
}

.os-doc p {
  margin-bottom: 14px;
  line-height: 1.7;
}

.os-doc-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.os-doc-stats li {
  padding: 8px 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  font-size: 0.86rem;
}

/* Settings (Skills) */
.os-settings {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 22px;
}

.os-settings aside {
  display: grid;
  align-content: start;
  gap: 4px;
}

.os-settings aside span {
  padding: 7px 10px;
  border-radius: 7px;
  color: #b9b9b5;
  font-size: 0.86rem;
}

.os-settings aside .is-active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.os-setting {
  display: grid;
  grid-template-columns: 170px 1fr 34px;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.9rem;
}

.os-setting em {
  color: #8f8f8b;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-style: normal;
  text-align: right;
}

.os-slider {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.os-slider::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--v);
  border-radius: inherit;
  background: #f2f2f0;
}

.os-slider i {
  position: absolute;
  top: 50%;
  left: var(--v);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
}

.os-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.os-tools span {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  font-size: 0.82rem;
}

/* Messages (Testimonials) */
.os-chat {
  display: grid;
  gap: 22px;
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 4px 30px;
}

.os-bubble-row {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: start;
}

.os-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #3a3a38;
  color: #f2f2f0;
  font-size: 0.8rem;
  font-weight: 700;
}

.os-bubble-name {
  margin-bottom: 6px;
  color: #f2f2f0;
  font-size: 0.84rem;
  font-weight: 700;
}

.os-bubble-name span {
  margin-left: 6px;
  color: #8f8f8b;
  font-weight: 500;
}

.os-bubble {
  max-width: 560px;
  padding: 12px 16px;
  border-radius: 18px 18px 18px 4px;
  background: #2e2e2c;
  color: #ececea;
  font-size: 0.94rem;
  line-height: 1.55;
}

.os-bubble-stars {
  margin-top: 6px;
  color: #c9c9c5;
  font-size: 0.78rem;
  letter-spacing: 0.15em;
}

/* Mail (Contact) */
.os-mail {
  display: grid;
  gap: 0;
  height: 100%;
}

.os-mail label {
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.os-mail label span {
  color: #8f8f8b;
  font-size: 0.86rem;
}

.os-mail input,
.os-mail textarea {
  width: 100%;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: #f2f2f0;
  font: inherit;
  font-size: 0.95rem;
}

.os-mail input:focus,
.os-mail textarea:focus {
  outline: none;
}

.os-mail textarea {
  min-height: 200px;
  padding-top: 16px;
  resize: none;
  line-height: 1.6;
}

.os-mail-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 12px;
}

.os-mail-status {
  color: #b9b9b5;
  font-size: 0.86rem;
}

/* Preview (Resume) */
.os-resume {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  align-items: center;
  gap: clamp(20px, 4vw, 48px);
  min-height: 100%;
  padding: 10px clamp(10px, 3vw, 40px);
}

.os-resume-page {
  display: grid;
  align-content: start;
  gap: 10px;
  aspect-ratio: 8.5 / 11;
  padding: 26px 22px;
  border-radius: 4px;
  background: #f4f4f0;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.os-resume-page b,
.os-resume-page i {
  display: block;
  height: 8px;
  border-radius: 2px;
  background: #cfcfca;
}

.os-resume-page b {
  width: 55%;
  height: 12px;
  margin-top: 8px;
  background: #1d1d1b;
}

.os-resume-page i:nth-child(odd) {
  width: 86%;
}

.os-resume-copy {
  display: grid;
  gap: 12px;
}

.os-resume-copy h3 {
  color: #f6f6f4;
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  font-weight: 900;
  line-height: 0.95;
}

.os-resume-copy p {
  color: #b9b9b5;
}

.os-resume-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.os-resume-actions [hidden] {
  display: none !important;
}

.os-resume-actions .button-primary::after {
  content: "↓";
}

/* ---------- Dock ---------- */
.os-dock {
  position: fixed;
  left: 50%;
  bottom: 12px;
  z-index: 55;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: rgba(30, 30, 30, 0.5);
  backdrop-filter: blur(26px) saturate(1.5);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
  transform: translateX(-50%);
}

.os-dock-app {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  background: none;
  color: #111110;
  transform-origin: 50% 100%;
  transition: transform 0.25s var(--ease), margin 0.25s var(--ease);
}

.os-dock-art {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  background: linear-gradient(180deg, #f6f6f3, #cfcfca);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 6px 14px rgba(0, 0, 0, 0.35);
}

.os-dock-art svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* hover magnification, like a real dock */
.os-dock-app:hover {
  transform: scale(1.32) translateY(-6px);
  margin: 0 10px;
}

.os-dock-app:hover + .os-dock-app {
  transform: scale(1.12) translateY(-2px);
}

.os-dock-tip {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(40, 40, 40, 0.92);
  color: #f2f2f0;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px) scale(calc(1 / 1.32));
  transition: opacity 0.15s ease;
}

.os-dock-app:hover .os-dock-tip {
  opacity: 1;
}

/* running indicator dot */
.os-dock-app::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #f2f2f0;
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity 0.2s ease;
}

.os-dock-app.is-running::after,
.os-dock-app.is-selected::after {
  opacity: 1;
}

.os-dock-divider {
  align-self: stretch;
  width: 1px;
  margin: 6px 2px;
  background: rgba(255, 255, 255, 0.18);
}

/* ---------- Quick Look ---------- */
.os-quicklook {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 50px 20px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.os-quicklook.is-open {
  opacity: 1;
}

.os-quicklook img {
  max-width: min(92vw, 1200px);
  max-height: 84vh;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transform: scale(0.94);
  transition: transform 0.35s var(--ease);
}

.os-quicklook.is-open img {
  transform: none;
}

.os-quicklook-close {
  position: absolute;
  top: 46px;
  right: 24px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(30, 30, 30, 0.8);
  color: #ffffff;
  font-size: 1.3rem;
}

/* ---------- Phones ---------- */
@media (max-width: 760px) {
  .os-menu-item,
  .os-menu-icon {
    display: none;
  }

  .os-menu-left,
  .os-menu-right {
    gap: 10px;
  }

  .os-hello {
    top: 140px;
    right: 16px;
  }

  .os-icons {
    top: 10px;
    left: 8px;
    right: 8px;
    grid-template-columns: repeat(6, 1fr);
    gap: 2px;
  }

  .os-icon {
    width: auto;
    padding: 4px 2px;
  }

  .os-icon-art svg {
    width: 40px;
    height: 32px;
  }

  .os-icon-label {
    font-size: 0.6rem;
  }

  .os-dock {
    gap: 4px;
    padding: 6px;
    border-radius: 18px;
  }

  .os-dock-app {
    width: 42px;
    height: 42px;
  }

  .os-dock-art {
    border-radius: 11px;
  }

  .os-dock-art svg {
    width: 22px;
    height: 22px;
  }

  .os-settings {
    grid-template-columns: 1fr;
  }

  .os-settings aside {
    display: none;
  }

  .os-setting {
    grid-template-columns: 1fr 1.2fr 30px;
  }

  .os-resume {
    grid-template-columns: 1fr;
  }

  .os-resume-page {
    max-width: 180px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .os-blob {
    animation: none;
  }
}

/* ==========================================================================
   Real desktop behaviour (visitor's own mouse)
   ========================================================================== */

/* Mac-style arrow pointer on every computer */
body.os,
body.os button,
body.os .os-titlebar {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M5 3.5v18.2l4.6-4.4 3 6.9 3.2-1.4-3-6.8h6.4z' fill='%23000' stroke='%23fff' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 5 3, default;
}

body.os a,
body.os .os-thumb,
body.os .os-track {
  cursor: pointer;
}

body.os input,
body.os textarea {
  cursor: text;
}

/* click ripple at the pointer */
.os-click {
  position: fixed;
  z-index: 120;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  pointer-events: none;
  animation: os-click 0.5s cubic-bezier(0.2, 0.9, 0.25, 1) forwards;
}

@keyframes os-click {
  from { opacity: 0.9; transform: scale(0.3); }
  to { opacity: 0; transform: scale(1.4); }
}

/* windows */
.os-window.is-open {
  visibility: visible;
}

.os-window.is-resizing {
  transition: left 0.35s var(--ease), top 0.35s var(--ease), width 0.35s var(--ease), height 0.35s var(--ease);
}

.os-window.is-dragging {
  box-shadow: 0 50px 120px rgba(0, 0, 0, 0.7), 0 0 0 0.5px rgba(0, 0, 0, 0.8);
}

.os-window.is-dragging .os-window-body {
  pointer-events: none;
}

.os-window:not(.is-focused) .os-titlebar h2 {
  color: #7d7d7a;
}

.os-window:not(.is-focused) {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 0.5px rgba(0, 0, 0, 0.8);
}

.os-titlebar {
  touch-action: none;
}

/* monochrome window buttons: all three light up together when you hover them */
.os-light {
  cursor: inherit;
  background: #5a5a58;
  transition: background-color 0.15s ease;
}

.os-window.is-focused .os-light-close { background: #d9d9d5; }
.os-window.is-focused .os-light-min { background: #a3a3a0; }
.os-window.is-focused .os-light-max { background: #747472; }

.os-lights:hover .os-light {
  position: relative;
}

.os-lights:hover .os-light::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #1a1a19;
  font-size: 9px;
  font-weight: 800;
  line-height: 12px;
}

.os-lights:hover .os-light-close::after { content: "×"; }
.os-lights:hover .os-light-min::after { content: "–"; }
.os-lights:hover .os-light-max::after { content: "+"; }

.os-window-notes .os-light-close { background: #9a9a96; }

/* the intro text steps back when windows are open */
.os-hello {
  transition: opacity 0.5s ease, filter 0.5s ease;
}

body.has-windows .os-hello {
  opacity: 0.25;
  filter: blur(2px);
}

.os-hello-hint {
  color: rgba(242, 242, 240, 0.7);
}

/* menu bar shortcuts */
a.os-menu-item {
  padding: 2px 6px;
  border-radius: 5px;
}

a.os-menu-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* dock: selected app dot */
.os-dock-app.is-running::after {
  opacity: 1;
}

@media (max-width: 760px) {
  .os-window {
    border-radius: 12px;
  }

  body.has-windows .os-hello {
    opacity: 0;
  }

  .os-menu-left a.os-menu-item {
    display: none;
  }
}

/* The picture viewer must be fully switched off until a picture is clicked */
.os-quicklook[hidden] {
  display: none;
}

.os-quicklook:not(.is-open) {
  pointer-events: none;
}

/* ==========================================================================
   COLOUR — real desktop colours
   ========================================================================== */
.os-wallpaper {
  background:
    radial-gradient(ellipse 55% 50% at 18% 22%, rgba(126, 87, 255, 0.85) 0%, transparent 62%),
    radial-gradient(ellipse 50% 55% at 82% 18%, rgba(37, 126, 255, 0.8) 0%, transparent 60%),
    radial-gradient(ellipse 60% 55% at 70% 88%, rgba(255, 112, 67, 0.8) 0%, transparent 62%),
    radial-gradient(ellipse 50% 50% at 22% 85%, rgba(255, 63, 140, 0.7) 0%, transparent 60%),
    linear-gradient(160deg, #1b1446 0%, #0e1a3d 45%, #2a0f2e 100%);
}

.os-wallpaper::after {
  /* soft darkening so text and windows stay readable */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 6, 20, 0.15), rgba(5, 6, 20, 0.35));
}

.os-blob-a {
  background: radial-gradient(circle at 40% 40%, rgba(160, 120, 255, 0.55), transparent 65%);
}

.os-blob-b {
  background: radial-gradient(circle at 50% 50%, rgba(255, 140, 90, 0.45), transparent 62%);
}

.os-wallpaper-mark {
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.12);
}

.os-hello-title,
.os-hello-role {
  text-shadow: 0 4px 30px rgba(10, 8, 40, 0.45);
}

.os-hello-kicker,
.os-hello-hint {
  color: rgba(255, 255, 255, 0.78);
}

.os-menubar {
  background: rgba(30, 24, 70, 0.35);
}

/* blue folders */
.os-icon-art .back { fill: #2f86e6; }
.os-icon-art .front { fill: url(#os-folder-gradient); fill: #5cb2ff; }

.os-icon.is-selected {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.22);
}

.os-icon.is-selected .os-icon-label {
  background: #2f7bff;
  color: #ffffff;
}

/* colourful app icons */
.os-app-art {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 23%;
  background: linear-gradient(160deg, var(--c1), var(--c2));
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 6px 16px rgba(0, 0, 0, 0.3);
}

.os-app-art svg {
  width: 56%;
  height: 56%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.os-app-art svg .solid {
  fill: currentColor;
  stroke: none;
}

.os-icon .os-app-art {
  display: none; /* desktop shows folders; phones show app icons */
}

.os-dock-app > .os-icon-label {
  display: none;
}

.os-dock-art {
  display: none;
}

/* real window buttons: red, yellow, green */
.os-window.is-focused .os-light-close,
.os-window-notes.is-focused .os-light-close { background: #ff5f57; }
.os-window.is-focused .os-light-min { background: #febc2e; }
.os-window.is-focused .os-light-max { background: #28c840; }

.os-lights:hover .os-light::after {
  color: rgba(0, 0, 0, 0.55);
}

.os-back,
.os-home-indicator {
  display: none;
}

/* coloured accents inside windows */
.os-track.is-active,
.os-track:hover {
  border-color: #2f7bff;
  background: rgba(47, 123, 255, 0.14);
}

.os-slider::before {
  background: linear-gradient(90deg, #2f7bff, #7a5cff);
}

.os-settings aside .is-active {
  background: #2f7bff;
}

.os-bubble {
  background: #34343a;
}

.os-avatar {
  background: linear-gradient(160deg, #8a95ff, #3b3fd6);
}

.os-bubble-row:nth-child(2) .os-avatar { background: linear-gradient(160deg, #45e3c9, #0a9e86); }
.os-bubble-row:nth-child(3) .os-avatar { background: linear-gradient(160deg, #ffa25e, #ff3d7f); }

.os-bubble-stars {
  color: #febc2e;
}

.os-tools span {
  border-color: rgba(47, 123, 255, 0.45);
  background: rgba(47, 123, 255, 0.1);
}

.os-window .button-primary {
  background: #2f7bff;
  border-color: #2f7bff;
  color: #ffffff;
}

.os-window .button-primary::before {
  background: #1f5fd6;
}

.os-window .button-primary:hover {
  color: #ffffff;
}

.os-menu-sound.is-playing {
  color: #65f286;
}

/* About doc: experience + education */
.os-doc h4 {
  margin: 28px 0 8px;
  color: #111110;
  font-size: 1.15rem;
  font-weight: 800;
}

.os-doc-role {
  margin-bottom: 10px !important;
  color: #8a6400;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.os-timeline {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.os-timeline li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.os-timeline strong {
  font-weight: 650;
}

.os-timeline span {
  flex: none;
  color: #6b6b67;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.os-doc-foot {
  margin-top: 24px !important;
  color: #6b6b67;
  font-size: 0.86rem;
}

.os-doc-foot a {
  color: #1269ef;
  text-decoration: underline;
}

.os-window-notes .os-doc-stats li {
  background: #fff6cf;
  border-color: #f5d76e;
}

/* Resume: live PDF preview */
.os-resume-page {
  padding: 0;
  overflow: hidden;
}

.os-resume-page iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.os-resume-placeholder {
  display: grid;
  align-content: start;
  gap: 10px;
  height: 100%;
  padding: 26px 22px;
}

.os-resume-placeholder b,
.os-resume-placeholder i {
  display: block;
  height: 8px;
  border-radius: 2px;
  background: #cfcfca;
}

.os-resume-placeholder b {
  width: 55%;
  height: 12px;
  margin-top: 8px;
  background: #1d1d1b;
}

.os-resume-summary {
  max-width: 460px;
  line-height: 1.6;
}

.os-window-preview .os-resume {
  grid-template-columns: minmax(260px, 380px) 1fr;
}

/* ==========================================================================
   iPHONE STYLE (phones)
   ========================================================================== */
@media (max-width: 760px) {
  body.os {
    --menubar: 46px;
  }

  /* status bar */
  .os-menubar {
    height: var(--menubar);
    padding: 6px 26px 0 30px;
    border: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .os-menu-left {
    display: none;
  }

  .os-status-time {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
  }

  .os-menu-right {
    gap: 6px;
  }

  .os-menu-right .os-menu-icon {
    display: block;
    width: 18px;
    height: 18px;
  }

  .os-menu-clock {
    display: none;
  }

  /* home screen */
  .os-desktop {
    overflow-y: auto;
    padding: 6px 20px 130px;
  }

  .os-hello {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    gap: 6px;
    margin: 8px 0 22px;
    padding: 18px 18px 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
  }

  .os-hello-kicker {
    font-size: 0.62rem;
  }

  .os-hello-title {
    font-size: 2.15rem;
  }

  .os-hello-role {
    font-size: 0.86rem;
  }

  .os-hello-hint {
    margin-top: 4px;
    font-size: 0.62rem;
  }

  body.has-windows .os-hello {
    opacity: 1;
    filter: none;
  }

  .os-icons {
    position: static;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px 10px;
    justify-items: center;
  }

  .os-icon {
    width: 100%;
    padding: 0;
    border: 0;
    gap: 6px;
  }

  .os-icon:hover,
  .os-icon.is-selected {
    background: transparent;
    border: 0;
  }

  .os-icon .os-icon-art {
    display: none;
  }

  .os-icon .os-app-art,
  .os-dock-app.os-icon .os-app-art {
    display: grid;
    width: 62px;
    height: 62px;
  }

  .os-icon .os-icon-label,
  .os-icons .os-dock-app > .os-icon-label {
    display: block;
    max-width: 76px;
    padding: 0;
    overflow: hidden;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: none !important;
  }

  .os-icon:active .os-app-art,
  .os-dock-app:active .os-app-art {
    filter: brightness(0.75);
    transform: scale(0.94);
  }

  /* About + Skills sit on the home screen grid as apps */
  .os-icons .os-dock-app {
    display: grid;
    justify-items: center;
    gap: 6px;
    width: 100%;
    height: auto;
    margin: 0;
  }

  .os-icons .os-dock-app .os-app-art {
    width: 62px;
    height: 62px;
  }

  .os-icons .os-dock-app:hover {
    transform: none;
    margin: 0;
  }

  .os-icons .os-dock-tip {
    display: none;
  }

  /* dock */
  .os-dock {
    bottom: 22px;
    gap: 16px;
    width: calc(100vw - 24px);
    justify-content: space-around;
    padding: 12px 14px;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.18);
  }

  .os-dock .os-dock-app {
    width: 60px;
    height: 60px;
  }

  .os-dock .os-dock-app:hover,
  .os-dock .os-dock-app:hover + .os-dock-app {
    transform: none;
    margin: 0;
  }

  .os-dock-app::after,
  .os-dock-divider,
  .os-dock-tip {
    display: none;
  }

  /* apps open full screen, like an iPhone */
  .os-window {
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #121214;
    grid-template-rows: auto 1fr auto;
  }

  .os-window-notes {
    background: #f6f5f0;
  }

  .os-titlebar {
    height: auto;
    padding: calc(var(--menubar) + 4px) 16px 12px;
    background: rgba(24, 24, 28, 0.94);
  }

  .os-window-notes .os-titlebar {
    background: rgba(246, 245, 240, 0.96);
  }

  .os-lights {
    display: none;
  }

  .os-back {
    position: absolute;
    left: 10px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 4px 6px;
    border: 0;
    background: none;
    color: #2f8bff;
    font-size: 1rem;
    font-weight: 500;
  }

  .os-back::before {
    content: "‹";
    font-size: 1.6rem;
    line-height: 0.8;
    font-weight: 400;
  }

  .os-titlebar h2 {
    max-width: 60%;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
  }

  .os-window-notes .os-titlebar h2 {
    color: #111110;
  }

  .os-window-body {
    padding: 16px 16px 8px;
  }

  .os-home-indicator {
    display: block;
    justify-self: center;
    width: 134px;
    height: 5px;
    margin: 8px 0 10px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 12px transparent; /* bigger tap area */
  }

  .os-window-notes .os-home-indicator {
    background: rgba(0, 0, 0, 0.8);
  }

  .os-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .os-playlist {
    grid-template-columns: 1fr 1fr;
  }

  .os-window-preview .os-resume {
    grid-template-columns: 1fr;
  }

  .os-resume-page {
    max-width: 200px;
  }

  .os-wallpaper-mark {
    font-size: 14rem;
    bottom: 18vh;
  }

  .os-click {
    display: none;
  }
}

@media (min-width: 761px) {
  .os-status-time {
    display: none;
  }
}

@media (max-width: 760px) {
  /* a full-screen app covers the dock, like on an iPhone */
  .os-dock {
    transition: transform 0.4s var(--ease), opacity 0.3s ease;
  }

  body.has-windows .os-dock {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 140%);
  }

  /* status bar turns dark over light apps */
  .os-menubar {
    z-index: 70;
    transition: color 0.3s ease;
  }

  body.has-windows[data-focus-kind="notes"] .os-menubar {
    color: #111110;
  }

  .os-player-info {
    display: grid;
    gap: 2px;
  }
}

/* ==========================================================================
   THEMES — 4 colour modes × light / dark
   (Cobalt is the default; fonts come from each colour mode)
   ========================================================================== */

/* ---- window chrome: dark (default) ---- */
body.os {
  --os-win-bg: rgba(24, 24, 27, 0.92);
  --os-win-solid: #131316;
  --os-win-fg: #ececea;
  --os-title-bg: rgba(36, 36, 40, 0.92);
  --os-title-fg: #dcdcd8;
  --os-muted: #92928e;
  --os-line: rgba(255, 255, 255, 0.08);
  --os-line-strong: rgba(255, 255, 255, 0.14);
  --os-card: rgba(255, 255, 255, 0.04);
  --os-bubble: #34343a;
  --os-bubble-fg: #ececea;
  --os-menubar-bg: rgba(15, 15, 25, 0.38);
  --os-menubar-fg: #f4f4f2;
  --os-dock-bg: rgba(30, 30, 36, 0.45);
  --os-dock-line: rgba(255, 255, 255, 0.14);
  --os-label: #ffffff;
  --os-label-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  --os-hello: #ffffff;
  --os-hello-soft: rgba(255, 255, 255, 0.76);
  --os-hello-shadow: 0 4px 30px rgba(10, 8, 40, 0.45);
  --os-widget: rgba(255, 255, 255, 0.14);
  --os-mark: rgba(255, 255, 255, 0.12);
  --os-wall-shade: linear-gradient(180deg, rgba(5, 6, 20, 0.15), rgba(5, 6, 20, 0.35));
}

/* ---- window chrome: light ---- */
body.os[data-theme="light"] {
  --os-win-bg: rgba(250, 250, 252, 0.94);
  --os-win-solid: #f5f5f7;
  --os-win-fg: #1d1d1f;
  --os-title-bg: rgba(236, 236, 240, 0.94);
  --os-title-fg: #3a3a3c;
  --os-muted: #6e6e73;
  --os-line: rgba(0, 0, 0, 0.08);
  --os-line-strong: rgba(0, 0, 0, 0.14);
  --os-card: rgba(0, 0, 0, 0.035);
  --os-bubble: #e9e9ed;
  --os-bubble-fg: #1d1d1f;
  --os-menubar-bg: rgba(255, 255, 255, 0.5);
  --os-menubar-fg: #111114;
  --os-dock-bg: rgba(255, 255, 255, 0.45);
  --os-dock-line: rgba(0, 0, 0, 0.08);
  --os-label: #16161a;
  --os-label-shadow: 0 1px 2px rgba(255, 255, 255, 0.7);
  --os-hello: #111114;
  --os-hello-soft: rgba(0, 0, 0, 0.6);
  --os-hello-shadow: none;
  --os-widget: rgba(255, 255, 255, 0.55);
  --os-mark: rgba(0, 0, 0, 0.08);
  --os-wall-shade: none;
}

/* ---- Cobalt (default): colourful aurora, blue accent ---- */
body.os,
html[data-mode="cobalt"] body.os {
  --os-accent: #2f7bff;
  --os-accent-ink: #ffffff;
  --os-folder-back: #2f86e6;
  --os-folder-front: #5cb2ff;
  --os-blob-a: rgba(160, 120, 255, 0.55);
  --os-blob-b: rgba(255, 140, 90, 0.45);
  --os-wall:
    radial-gradient(ellipse 55% 50% at 18% 22%, rgba(126, 87, 255, 0.85) 0%, transparent 62%),
    radial-gradient(ellipse 50% 55% at 82% 18%, rgba(37, 126, 255, 0.8) 0%, transparent 60%),
    radial-gradient(ellipse 60% 55% at 70% 88%, rgba(255, 112, 67, 0.8) 0%, transparent 62%),
    radial-gradient(ellipse 50% 50% at 22% 85%, rgba(255, 63, 140, 0.7) 0%, transparent 60%),
    linear-gradient(160deg, #1b1446 0%, #0e1a3d 45%, #2a0f2e 100%);
}

html[data-mode="cobalt"] body.os[data-theme="light"],
body.os[data-theme="light"] {
  --os-accent: #2c5bff;
  --os-blob-a: rgba(150, 120, 255, 0.4);
  --os-blob-b: rgba(255, 160, 120, 0.35);
  --os-wall:
    radial-gradient(ellipse 55% 50% at 18% 22%, rgba(150, 120, 255, 0.55) 0%, transparent 62%),
    radial-gradient(ellipse 50% 55% at 82% 18%, rgba(80, 150, 255, 0.55) 0%, transparent 60%),
    radial-gradient(ellipse 60% 55% at 70% 88%, rgba(255, 150, 110, 0.5) 0%, transparent 62%),
    radial-gradient(ellipse 50% 50% at 22% 85%, rgba(255, 120, 180, 0.45) 0%, transparent 60%),
    linear-gradient(160deg, #eef0ff 0%, #e6f0ff 45%, #fde9f1 100%);
}

/* ---- Monochrome ---- */
html[data-mode="mono"] body.os {
  --os-accent: #f2f2f0;
  --os-accent-ink: #0b0b0b;
  --os-folder-back: #6f6f6c;
  --os-folder-front: #c9c9c5;
  --os-blob-a: rgba(255, 255, 255, 0.14);
  --os-blob-b: rgba(255, 255, 255, 0.09);
  --os-wall:
    radial-gradient(ellipse 70% 60% at 30% 25%, #2b2b2b 0%, transparent 60%),
    radial-gradient(ellipse 60% 70% at 80% 80%, #1e1e1e 0%, transparent 60%),
    #0a0a0a;
}

html[data-mode="mono"] body.os[data-theme="light"] {
  --os-accent: #111114;
  --os-accent-ink: #ffffff;
  --os-folder-back: #9a9a96;
  --os-folder-front: #d6d6d2;
  --os-blob-a: rgba(255, 255, 255, 0.8);
  --os-blob-b: rgba(0, 0, 0, 0.05);
  --os-wall:
    radial-gradient(ellipse 70% 60% at 30% 25%, #ffffff 0%, transparent 60%),
    radial-gradient(ellipse 60% 70% at 80% 80%, #dcdcd8 0%, transparent 60%),
    #ededea;
}

/* ---- Acid: neon lime ---- */
html[data-mode="acid"] body.os {
  --os-accent: #c6ff2e;
  --os-accent-ink: #0a0b08;
  --os-folder-back: #6f9a12;
  --os-folder-front: #c6ff2e;
  --os-blob-a: rgba(198, 255, 46, 0.3);
  --os-blob-b: rgba(120, 200, 0, 0.22);
  --os-wall:
    radial-gradient(ellipse 55% 50% at 18% 22%, rgba(198, 255, 46, 0.32) 0%, transparent 62%),
    radial-gradient(ellipse 55% 55% at 85% 80%, rgba(110, 190, 0, 0.3) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 70% 20%, rgba(220, 255, 120, 0.14) 0%, transparent 60%),
    linear-gradient(160deg, #0b0d06 0%, #10140a 100%);
}

html[data-mode="acid"] body.os[data-theme="light"] {
  --os-accent: #4d7a00;
  --os-accent-ink: #ffffff;
  --os-folder-back: #7fae12;
  --os-folder-front: #c6ff2e;
  --os-blob-a: rgba(198, 255, 46, 0.5);
  --os-blob-b: rgba(160, 220, 40, 0.35);
  --os-wall:
    radial-gradient(ellipse 55% 50% at 18% 22%, rgba(198, 255, 46, 0.6) 0%, transparent 62%),
    radial-gradient(ellipse 55% 55% at 85% 80%, rgba(160, 220, 40, 0.45) 0%, transparent 60%),
    linear-gradient(160deg, #f6f9ec 0%, #eef3dc 100%);
}

/* ---- Sunset: coral & cream ---- */
html[data-mode="sunset"] body.os {
  --os-accent: #ff5b2e;
  --os-accent-ink: #ffffff;
  --os-folder-back: #d94a22;
  --os-folder-front: #ff8a5c;
  --os-blob-a: rgba(255, 110, 60, 0.45);
  --os-blob-b: rgba(255, 190, 110, 0.3);
  --os-wall:
    radial-gradient(ellipse 55% 50% at 20% 20%, rgba(255, 91, 46, 0.6) 0%, transparent 62%),
    radial-gradient(ellipse 50% 50% at 80% 28%, rgba(255, 170, 90, 0.45) 0%, transparent 60%),
    radial-gradient(ellipse 60% 55% at 60% 90%, rgba(200, 40, 90, 0.5) 0%, transparent 62%),
    linear-gradient(160deg, #1d120d 0%, #2b130f 100%);
}

html[data-mode="sunset"] body.os[data-theme="light"] {
  --os-accent: #e2481c;
  --os-blob-a: rgba(255, 130, 90, 0.4);
  --os-blob-b: rgba(255, 200, 130, 0.45);
  --os-wall:
    radial-gradient(ellipse 55% 50% at 20% 20%, rgba(255, 120, 80, 0.45) 0%, transparent 62%),
    radial-gradient(ellipse 50% 50% at 80% 28%, rgba(255, 200, 120, 0.55) 0%, transparent 60%),
    radial-gradient(ellipse 60% 55% at 60% 90%, rgba(255, 110, 150, 0.35) 0%, transparent 62%),
    linear-gradient(160deg, #f8efe4 0%, #f4e6d6 100%);
}

/* ---- apply the variables ---- */
body.os.os-switching,
body.os.os-switching * {
  transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease, fill 0.5s ease !important;
}

.os-wallpaper { background: var(--os-wall); transition: background 0.6s ease; }
.os-wallpaper::after { background: var(--os-wall-shade); }
.os-blob-a { background: radial-gradient(circle at 40% 40%, var(--os-blob-a), transparent 65%); }
.os-blob-b { background: radial-gradient(circle at 50% 50%, var(--os-blob-b), transparent 62%); }
.os-wallpaper-mark { -webkit-text-stroke-color: var(--os-mark); }

.os-menubar { background: var(--os-menubar-bg); color: var(--os-menubar-fg); }
.os-menu-item { color: inherit; opacity: 0.86; }
a.os-menu-item:hover { color: inherit; background: color-mix(in srgb, var(--os-menubar-fg) 14%, transparent); opacity: 1; }
.os-menu-sound.is-playing { color: var(--os-accent); }
.os-menu-logo img { filter: none; }
body.os[data-theme="light"] .os-menu-logo img { filter: invert(1); }

.os-hello-title,
.os-hello-role { color: var(--os-hello); text-shadow: var(--os-hello-shadow); }
.os-hello-kicker,
.os-hello-hint { color: var(--os-hello-soft); }
.os-hello-title { font-size: calc(clamp(2.8rem, 8vw, 7rem) * var(--display-scale, 1)); }

.os-icon { color: var(--os-label); }
.os-icon-label { text-shadow: var(--os-label-shadow); }
.os-icon.is-selected .os-icon-label { background: var(--os-accent); color: var(--os-accent-ink); text-shadow: none; }
.os-icon-art .back { fill: var(--os-folder-back); }
.os-icon-art .front { fill: var(--os-folder-front); }

/* PDF file icon on the desktop */
.os-file .os-icon-art svg { width: 42px; height: 52px; }
.os-file .page { fill: #fbfbf9; stroke: rgba(0, 0, 0, 0.18); stroke-width: 1; }
.os-file .fold { fill: #e3e3df; stroke: rgba(0, 0, 0, 0.18); stroke-width: 1; }
.os-file .band { fill: #ff3b30; }
.os-file text { fill: #ffffff; font: 800 9px var(--font-body); letter-spacing: 0.5px; }

.os-window { background: var(--os-win-bg); color: var(--os-win-fg); border-color: var(--os-line-strong); }
.os-titlebar { background: var(--os-title-bg); border-bottom-color: var(--os-line); }
.os-titlebar h2 { color: var(--os-title-fg); }
.os-window:not(.is-focused) .os-titlebar h2 { color: var(--os-muted); }

.os-meta,
.os-player-info span,
.os-track em,
.os-logo-card span,
.os-setting em,
.os-mail label span,
.os-mail-status,
.os-bubble-name span,
.os-resume-copy p,
.os-settings aside span { color: var(--os-muted); }

.os-player-info strong,
.os-logo-card strong,
.os-resume-copy h3,
.os-bubble-name,
.os-track strong { color: var(--os-win-fg); }

.os-thumb { background: var(--os-card); }
.os-track { border-color: var(--os-line); background: var(--os-card); }
.os-track.is-active,
.os-track:hover { border-color: var(--os-accent); background: color-mix(in srgb, var(--os-accent) 14%, transparent); }
.os-logo-card { border-color: var(--os-line); }
.os-settings aside .is-active { background: var(--os-accent); color: var(--os-accent-ink); }
.os-setting { border-bottom-color: var(--os-line); }
.os-slider { background: var(--os-line-strong); }
.os-slider::before { background: var(--os-accent); }
.os-tools span { border-color: color-mix(in srgb, var(--os-accent) 45%, transparent); background: color-mix(in srgb, var(--os-accent) 12%, transparent); color: var(--os-win-fg); }
.os-bubble { background: var(--os-bubble); color: var(--os-bubble-fg); }
.os-mail label { border-bottom-color: var(--os-line); }
.os-mail input,
.os-mail textarea { color: var(--os-win-fg); }

.os-window .button-primary { background: var(--os-accent); border-color: var(--os-accent); color: var(--os-accent-ink); }
.os-window .button-primary::before { background: color-mix(in srgb, var(--os-accent) 80%, #000); }
.os-window .button-primary:hover { color: var(--os-accent-ink); }
.os-window .button-secondary { color: var(--os-win-fg); border-color: var(--os-line-strong); }
.os-window .button-secondary::before { background: var(--os-win-fg); }
.os-window .button-secondary:hover { color: var(--os-win-solid); }

.os-dock { background: var(--os-dock-bg); border-color: var(--os-dock-line); }
.os-dock-app::after { background: var(--os-menubar-fg); }
.os-dock-tip { background: var(--os-title-bg); color: var(--os-win-fg); }
.os-click { border-color: var(--os-hello-soft); }

/* monochrome mode keeps grey window buttons */
html[data-mode="mono"] .os-window.is-focused .os-light-close { background: #d9d9d5; }
html[data-mode="mono"] .os-window.is-focused .os-light-min { background: #a3a3a0; }
html[data-mode="mono"] .os-window.is-focused .os-light-max { background: #747472; }
html[data-mode="mono"] body.os[data-theme="light"] .os-window.is-focused .os-light-close { background: #3a3a3c; }
html[data-mode="mono"] body.os[data-theme="light"] .os-window.is-focused .os-light-min { background: #6e6e73; }
html[data-mode="mono"] body.os[data-theme="light"] .os-window.is-focused .os-light-max { background: #a1a1a6; }

/* Resume: real page preview */
.os-resume-page.is-rendered {
  aspect-ratio: auto;
  background: #ffffff;
}

.os-resume-sheet {
  display: block;
  cursor: zoom-in;
}

.os-resume-sheet canvas {
  display: block;
  width: 100%;
  height: auto;
}

/* ---- Control Center ---- */
.os-menu-control {
  display: grid;
  place-items: center;
  height: 22px;
  padding: 0 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
}

.os-menu-control svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.os-menu-control svg .solid {
  fill: currentColor;
  stroke: none;
}

.os-menu-control:hover,
.os-menu-control[aria-expanded="true"] {
  background: color-mix(in srgb, var(--os-menubar-fg) 16%, transparent);
}

.os-control {
  position: fixed;
  top: calc(var(--menubar) + 6px);
  right: 10px;
  z-index: 95;
  display: grid;
  gap: 8px;
  width: 320px;
  padding: 14px;
  border: 1px solid var(--os-line-strong);
  border-radius: 18px;
  background: color-mix(in srgb, var(--os-win-solid) 82%, transparent);
  backdrop-filter: blur(30px) saturate(1.6);
  -webkit-backdrop-filter: blur(30px) saturate(1.6);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  color: var(--os-win-fg);
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  transform-origin: top right;
  transition: opacity 0.2s ease, transform 0.3s var(--ease);
}

.os-control.is-open {
  opacity: 1;
  transform: none;
}

.os-control[hidden] {
  display: none;
}

.os-control-title {
  margin: 4px 4px 2px;
  color: var(--os-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.os-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--os-card);
}

.os-segment button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--os-win-fg);
  font-size: 0.86rem;
  font-weight: 600;
}

.os-segment svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.os-segment button[aria-pressed="true"] {
  background: var(--os-accent);
  color: var(--os-accent-ink);
}

.os-modes {
  display: grid;
  gap: 4px;
}

.os-mode {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--os-win-fg);
  text-align: left;
}

.os-mode:hover {
  background: var(--os-card);
}

.os-mode[aria-pressed="true"] {
  border-color: var(--os-accent);
  background: color-mix(in srgb, var(--os-accent) 10%, transparent);
}

.os-mode-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sw-a) 50%, var(--sw-b) 50%);
  box-shadow: inset 0 0 0 1px rgba(128, 128, 128, 0.35);
}

.os-mode-copy {
  display: grid;
}

.os-mode-copy strong {
  font-size: 0.9rem;
}

.os-mode-copy em {
  color: var(--os-muted);
  font-size: 0.74rem;
  font-style: normal;
}

.os-mode-sample {
  font-size: 1.35rem;
  font-weight: 800;
}

/* ---- phones ---- */
@media (max-width: 760px) {
  .os-menubar { background: transparent; color: var(--os-label); }
  .os-hello { background: var(--os-widget); }
  .os-hello-title { font-size: calc(2.15rem * var(--display-scale, 1)); }
  .os-icon .os-icon-label,
  .os-icons .os-dock-app > .os-icon-label { color: var(--os-label); text-shadow: var(--os-label-shadow); }
  .os-file { display: none !important; }
  .os-window { background: var(--os-win-solid); }
  .os-titlebar { background: var(--os-title-bg); }
  .os-titlebar h2 { color: var(--os-win-fg); }
  .os-back { color: var(--os-accent); }
  html[data-mode="mono"] body.os:not([data-theme="light"]) .os-back { color: #ffffff; }
  .os-home-indicator { background: var(--os-win-fg); }
  .os-window-notes .os-titlebar h2 { color: #111110; }
  .os-window-notes .os-home-indicator { background: rgba(0, 0, 0, 0.8); }
  body.has-windows .os-menubar { color: var(--os-win-fg); }
  body.has-windows[data-focus-kind="notes"] .os-menubar { color: #111110; }
  .os-dock { background: var(--os-dock-bg); }
  .os-resume-page { max-width: none; }
  .os-control {
    left: 10px;
    right: 10px;
    width: auto;
  }
  .os-menu-control,
  .os-menu-sound { display: grid; }
}

/* ==========================================================================
   About (Notes) window follows light / dark mode
   ========================================================================== */
body.os {
  --os-notes-bg: #1f1e1b;
  --os-notes-title: rgba(40, 38, 34, 0.96);
  --os-notes-fg: #f3f1ea;
  --os-notes-muted: #a8a59c;
  --os-notes-line: rgba(255, 255, 255, 0.09);
  --os-notes-role: #f5c84b;
  --os-notes-chip-bg: rgba(255, 204, 0, 0.12);
  --os-notes-chip-line: rgba(255, 204, 0, 0.35);
}

body.os[data-theme="light"] {
  --os-notes-bg: #f6f5f0;
  --os-notes-title: rgba(232, 231, 226, 0.96);
  --os-notes-fg: #1d1d1b;
  --os-notes-muted: #6b6b67;
  --os-notes-line: rgba(0, 0, 0, 0.08);
  --os-notes-role: #8a6400;
  --os-notes-chip-bg: #fff6cf;
  --os-notes-chip-line: #f5d76e;
}

.os-window.os-window-notes {
  background: var(--os-notes-bg);
  color: var(--os-notes-fg);
}

.os-window.os-window-notes .os-titlebar {
  background: var(--os-notes-title);
  border-bottom-color: var(--os-notes-line);
}

.os-window.os-window-notes .os-titlebar h2 {
  color: var(--os-notes-fg);
}

.os-window.os-window-notes:not(.is-focused) .os-titlebar h2 {
  color: var(--os-notes-muted);
}

.os-window-notes .os-doc h3,
.os-window-notes .os-doc h4,
.os-window-notes .os-doc-lead,
.os-window-notes .os-doc p,
.os-window-notes .os-timeline strong {
  color: var(--os-notes-fg);
}

.os-window-notes .os-doc-date,
.os-window-notes .os-timeline span,
.os-window-notes .os-doc-foot {
  color: var(--os-notes-muted);
}

.os-window-notes .os-doc-role {
  color: var(--os-notes-role);
}

.os-window-notes .os-timeline li {
  border-bottom-color: var(--os-notes-line);
}

.os-window-notes .os-doc-stats li {
  background: var(--os-notes-chip-bg);
  border-color: var(--os-notes-chip-line);
  color: var(--os-notes-fg);
}

.os-window-notes .os-doc-foot a {
  color: var(--os-accent);
}

html[data-mode="mono"] body.os[data-theme="light"] .os-window-notes .os-doc-foot a {
  color: #111114;
}

@media (max-width: 760px) {
  .os-window.os-window-notes {
    background: var(--os-notes-bg);
  }

  .os-window.os-window-notes .os-titlebar h2 {
    color: var(--os-notes-fg);
  }

  .os-window.os-window-notes .os-home-indicator {
    background: var(--os-notes-fg);
  }

  body.has-windows[data-focus-kind="notes"] .os-menubar {
    color: var(--os-notes-fg);
  }
}

/* Titled video cards inside folders */
.os-reel {
  display: grid;
  gap: 8px;
  margin: 0;
}

.os-reel video {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 10px;
  background: #000;
}

.os-reel figcaption {
  color: var(--os-win-fg);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
}

.os-grid-video {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

/* LinkedIn */
.os-app-art svg .os-in {
  font: 800 13px var(--font-body);
  letter-spacing: -0.5px;
}

.os-mail-alt {
  margin-top: 10px;
  color: var(--os-muted);
  font-size: 0.86rem;
}

.os-mail-alt a {
  color: var(--os-accent);
  font-weight: 600;
}

/* ==========================================================================
   Organised folders (Finder style)
   ========================================================================== */
.os-window-body {
  position: relative;
}

.os-finder {
  display: grid;
  grid-template-columns: 186px minmax(0, 1fr);
  gap: 22px;
  min-height: 100%;
}

.os-finder-side {
  position: sticky;
  top: 0;
  align-self: start;
  display: grid;
  gap: 2px;
  padding-right: 14px;
  border-right: 1px solid var(--os-line);
}

.os-finder-side-title {
  margin: 2px 10px 8px;
  color: var(--os-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.os-finder-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--os-win-fg);
  font-size: 0.86rem;
  font-weight: 500;
  text-align: left;
}

.os-finder-link em {
  color: var(--os-muted);
  font-size: 0.72rem;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.os-finder-link:hover {
  background: var(--os-card);
}

.os-finder-link.is-active {
  background: var(--os-accent);
  color: var(--os-accent-ink);
}

.os-finder-link.is-active em {
  color: inherit;
  opacity: 0.8;
}

.os-finder-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--os-line);
}

.os-finder-count {
  color: var(--os-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.os-view-toggle {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: var(--os-card);
}

.os-view-toggle button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 26px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--os-muted);
}

.os-view-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.os-view-toggle button[aria-pressed="true"] {
  background: var(--os-accent);
  color: var(--os-accent-ink);
}

.os-finder-section {
  margin-bottom: 30px;
}

.os-finder-section > header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.os-finder-section h3 {
  color: var(--os-win-fg);
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.os-finder-section > header span {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--os-card);
  color: var(--os-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

/* Grid view: tidy tiles that show the whole design */
.os-items-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 16px 12px;
}

.os-item {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--os-win-fg);
  text-align: center;
  cursor: zoom-in;
}

.os-item:hover {
  background: var(--os-card);
}

.os-item:focus-visible {
  outline: 2px solid var(--os-accent);
  outline-offset: 1px;
}

.os-item-thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  padding: 8px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--os-card);
}

.os-item-thumb img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.4s var(--ease);
}

.os-item:hover .os-item-thumb img {
  transform: scale(1.04);
}

.os-item-name {
  overflow: hidden;
  color: var(--os-muted);
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.os-item:hover .os-item-name {
  color: var(--os-win-fg);
}

/* Gallery view: big pictures, natural shapes */
.os-finder[data-view="gallery"] .os-items-images {
  display: block;
  columns: 3 230px;
  column-gap: 14px;
}

.os-finder[data-view="gallery"] .os-item {
  width: 100%;
  margin-bottom: 14px;
  padding: 0;
  text-align: left;
  break-inside: avoid;
}

.os-finder[data-view="gallery"] .os-item:hover {
  background: transparent;
}

.os-finder[data-view="gallery"] .os-item-thumb {
  aspect-ratio: auto;
  padding: 0;
  background: none;
}

.os-finder[data-view="gallery"] .os-item-thumb img {
  width: 100%;
  max-height: none;
  border-radius: 10px;
  box-shadow: none;
}

.os-items-video {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

/* Quick Look navigation */
.os-ql-nav {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(30, 30, 30, 0.75);
  color: #ffffff;
  font-size: 1.8rem;
  line-height: 1;
  transform: translateY(-50%);
}

.os-ql-nav:hover {
  background: rgba(60, 60, 60, 0.9);
}

.os-ql-prev { left: 20px; }
.os-ql-next { right: 20px; }

.os-quicklook.is-single .os-ql-nav {
  display: none;
}

.os-ql-caption {
  position: absolute;
  bottom: 22px;
  left: 50%;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.7);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transform: translateX(-50%);
}

@media (max-width: 760px) {
  .os-finder {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .os-finder-side {
    position: sticky;
    top: -16px;
    z-index: 3;
    display: flex;
    gap: 6px;
    margin: -16px -16px 0;
    padding: 10px 16px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--os-line);
    background: var(--os-win-solid);
    scrollbar-width: none;
  }

  .os-finder-side-title {
    display: none;
  }

  .os-finder-link {
    flex: none;
    border: 1px solid var(--os-line-strong);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .os-items-images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .os-finder[data-view="gallery"] .os-items-images {
    columns: 1;
  }

  .os-items-video {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .os-ql-nav {
    top: auto;
    bottom: 70px;
    transform: none;
  }

  .os-ql-caption {
    bottom: 80px;
  }
}

/* ==========================================================================
   Lock screen
   ========================================================================== */
.os-lock {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  justify-items: center;
  padding: clamp(40px, 9vh, 90px) 24px clamp(34px, 7vh, 70px);
  overflow: hidden;
  background: var(--os-wall);
  color: var(--os-hello);
  text-align: center;
  transition: opacity 0.85s var(--ease), transform 0.9s var(--ease), filter 0.85s var(--ease);
}

.os-lock::before {
  /* frosted glass over the wallpaper */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--os-win-solid) 22%, transparent);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
}

html.os-unlocked .os-lock {
  display: none;
}

.os-lock.is-unlocking {
  opacity: 0;
  transform: translateY(-3%) scale(1.03);
  filter: blur(10px);
  pointer-events: none;
}

/* the desktop "wakes up" behind the lock screen */
html:not(.os-unlocked) .os-desktop,
html:not(.os-unlocked) .os-dock,
html:not(.os-unlocked) .os-menubar {
  opacity: 0;
}

html:not(.os-unlocked) .os-desktop {
  transform: scale(1.04);
}

body.os-waking .os-desktop,
body.os-waking .os-dock,
body.os-waking .os-menubar {
  opacity: 1;
  transform: none;
  transition: opacity 0.9s var(--ease) 0.15s, transform 1s var(--ease) 0.1s;
}

body.os-waking .os-dock {
  transform: translateX(-50%);
}

.os-lock-clock {
  display: grid;
  gap: 4px;
}

.os-lock-date {
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-weight: 600;
  opacity: 0.9;
}

.os-lock-time {
  font-family: var(--font-display);
  font-size: calc(clamp(5rem, 13vw, 9.5rem) * var(--display-scale, 1));
  font-weight: 700;
  font-stretch: 105%;
  line-height: 0.92;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  text-shadow: var(--os-hello-shadow);
}

.os-lock-notification {
  display: none;
}

.os-lock-user {
  grid-row: 3;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.os-lock-avatar {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: linear-gradient(160deg, color-mix(in srgb, var(--os-accent) 70%, #ffffff), var(--os-accent));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3), inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.os-lock-avatar img {
  width: 54%;
  height: auto;
}

html[data-mode="mono"] .os-lock-avatar,
html[data-mode="acid"] .os-lock-avatar {
  background: linear-gradient(160deg, #3a3a3a, #0b0b0b);
}

.os-lock-name {
  font-size: 1.3rem;
  font-weight: 700;
}

.os-lock-role {
  font-size: 0.86rem;
  opacity: 0.75;
}

.os-lock-field {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding: 10px 10px 10px 20px;
  border: 1px solid color-mix(in srgb, var(--os-hello) 30%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--os-hello) 14%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--os-hello);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.25s ease, transform 0.25s var(--ease);
}

.os-lock-field:hover {
  background: color-mix(in srgb, var(--os-hello) 22%, transparent);
  transform: translateY(-1px);
}

.os-lock-arrow {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--os-hello);
  color: var(--os-win-solid);
  font-weight: 800;
}

.os-lock-sound {
  margin-top: 4px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--os-hello);
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0.75;
}

.os-lock-sound:hover {
  opacity: 1;
  background: color-mix(in srgb, var(--os-hello) 12%, transparent);
}

.os-lock-swipe {
  display: none;
}

/* ---- iPhone lock screen ---- */
@media (max-width: 760px) {
  .os-lock {
    grid-template-rows: auto auto 1fr auto auto;
    padding: 70px 16px 10px;
  }

  .os-lock-time {
    font-size: calc(5.6rem * var(--display-scale, 1));
  }

  .os-lock-notification {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 12px;
    width: 100%;
    max-width: 380px;
    margin-top: 34px;
    padding: 12px 14px;
    border-radius: 20px;
    background: color-mix(in srgb, var(--os-hello) 16%, transparent);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    text-align: left;
    font-size: 0.86rem;
    line-height: 1.4;
  }

  .os-lock-notification-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(160deg, #3a3a3a, #0b0b0b);
  }

  .os-lock-notification-icon img {
    width: 60%;
  }

  .os-lock-notification-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
  }

  .os-lock-notification-top span {
    opacity: 0.6;
    font-size: 0.78rem;
  }

  .os-lock-user {
    grid-row: 4;
    gap: 4px;
  }

  .os-lock-avatar,
  .os-lock-name,
  .os-lock-role,
  .os-lock-field {
    display: none;
  }

  .os-lock-swipe {
    grid-row: 5;
    display: grid;
    justify-items: center;
    gap: 12px;
    padding-top: 10px;
    font-size: 0.86rem;
    font-weight: 600;
    animation: swipe-hint 2.2s ease-in-out infinite;
  }

  .os-lock-swipe i {
    width: 134px;
    height: 5px;
    border-radius: 999px;
    background: var(--os-hello);
  }

  @keyframes swipe-hint {
    0%, 100% { transform: translateY(0); opacity: 0.7; }
    50% { transform: translateY(-6px); opacity: 1; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .os-lock-swipe {
    animation: none;
  }
}

/* ==========================================================================
   Folders on iPhone: Photos-app style
   ========================================================================== */
@media (max-width: 760px) {
  .os-window-folder .os-window-body {
    padding: 0 0 24px;
  }

  .os-finder {
    display: block;
  }

  /* frosted section bar under the title */
  .os-finder-side {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 10px 16px;
    overflow-x: auto;
    border: 0;
    border-bottom: 1px solid var(--os-line);
    background: color-mix(in srgb, var(--os-win-solid) 86%, transparent);
    backdrop-filter: blur(20px) saturate(1.6);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    scrollbar-width: none;
  }

  .os-finder-side::-webkit-scrollbar {
    display: none;
  }

  .os-finder-link {
    flex: none;
    gap: 6px;
    padding: 7px 14px;
    border: 0;
    border-radius: 999px;
    background: var(--os-card);
    font-size: 0.82rem;
    font-weight: 600;
  }

  .os-finder-link em {
    font-size: 0.72rem;
  }

  /* the "20 items" bar and Grid/Gallery switch are desktop-only */
  .os-finder-bar {
    display: none;
  }

  .os-finder-section {
    margin: 0 0 22px;
  }

  .os-finder-section > header {
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 18px 16px 10px;
  }

  .os-finder-section h3 {
    font-family: var(--font-body);
    font-size: 1.3rem;
    font-weight: 700;
    font-stretch: 100%;
    letter-spacing: -0.02em;
    text-transform: none;
  }

  .os-finder-section > header span {
    background: none;
    padding: 0;
    font-size: 0.86rem;
    font-weight: 500;
  }

  .os-finder-section > header span::after {
    content: " items";
  }

  /* edge-to-edge photo grid */
  .os-finder .os-items-images,
  .os-finder[data-view="gallery"] .os-items-images {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    columns: auto;
  }

  .os-finder .os-item,
  .os-finder[data-view="gallery"] .os-item {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
  }

  .os-finder .os-item-thumb,
  .os-finder[data-view="gallery"] .os-item-thumb {
    display: block;
    aspect-ratio: 1 / 1;
    padding: 0;
    border-radius: 0;
    background: var(--os-card);
  }

  .os-finder .os-item-thumb img,
  .os-finder[data-view="gallery"] .os-item-thumb img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
    transform: none !important;
  }

  .os-finder .os-item:active .os-item-thumb img {
    opacity: 0.7;
  }

  /* names show in the full-screen preview instead */
  .os-finder .os-item-name {
    display: none;
  }

  /* videos: 2 per row with titles */
  .os-finder .os-items-video {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 10px;
    padding: 0 16px;
  }

  .os-reel video {
    border-radius: 12px;
  }

  .os-reel figcaption {
    font-size: 0.8rem;
  }

  /* full-screen preview: arrows at the bottom, caption above them */
  .os-quicklook {
    padding: 60px 0 120px;
  }

  .os-quicklook img {
    max-width: 100vw;
    max-height: 70vh;
    border-radius: 0;
  }

  .os-ql-nav {
    bottom: 34px;
    width: 52px;
    height: 52px;
  }

  .os-ql-prev { left: 24px; }
  .os-ql-next { right: 24px; }

  .os-ql-caption {
    bottom: 46px;
    max-width: calc(100vw - 170px);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .os-quicklook-close {
    top: 54px;
    right: 16px;
  }
}

@media (max-width: 760px) {
  .os-finder-section > header span[data-one="1"]::after {
    content: " item";
  }

  /* wide banners: full row, natural shape (nothing cut off) */
  .os-finder .os-item.is-wide {
    grid-column: 1 / -1;
  }

  .os-finder .os-item.is-wide .os-item-thumb {
    aspect-ratio: auto;
  }

  .os-finder .os-item.is-wide .os-item-thumb img {
    height: auto;
    object-fit: contain;
  }
}

@media (max-width: 760px) {
  .os-finder .os-items-images,
  .os-finder[data-view="gallery"] .os-items-images {
    grid-auto-flow: row dense;
  }
}

/* Computer grid view: wide works take two tiles so they aren't tiny */
@media (min-width: 761px) {
  .os-finder[data-view="grid"] .os-items-images {
    grid-auto-flow: row dense;
  }

  .os-finder[data-view="grid"] .os-item.is-wide {
    grid-column: span 2;
  }

  .os-finder[data-view="grid"] .os-item.is-wide .os-item-thumb {
    aspect-ratio: auto;
    height: 100%;
    min-height: 0;
  }

  .os-finder[data-view="grid"] .os-item.is-wide {
    grid-template-rows: 1fr auto;
  }
}

/* ==========================================================================
   Real iPhones: no duplicate status bar, apps always full screen
   ========================================================================== */
@media (max-width: 760px) {
  html,
  body.os {
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* the phone already shows the real time / Wi-Fi / battery */
  .os-status-time,
  .os-menu-right .os-menu-icon,
  .os-menu-clock {
    display: none !important;
  }

  .os-menubar {
    left: auto;
    right: 12px;
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    height: auto;
    padding: 4px;
    border: 1px solid color-mix(in srgb, var(--os-label) 18%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--os-win-solid) 40%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .os-menu-right {
    gap: 2px;
  }

  .os-menu-control,
  .os-menu-sound {
    width: 34px;
    height: 30px;
    border-radius: 999px;
  }

  /* inside an app, the app's own header takes over */
  body.has-windows .os-menubar {
    opacity: 0;
    pointer-events: none;
  }

  .os-desktop {
    inset: 0;
    padding-top: calc(env(safe-area-inset-top, 0px) + 58px);
  }

  .os-control {
    top: calc(env(safe-area-inset-top, 0px) + 56px);
  }

  /* apps: pinned edge to edge, solid background */
  .os-window,
  .os-window.os-window-notes {
    position: fixed !important;
    inset: 0 !important;
    width: auto !important;
    height: auto !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .os-window {
    background: var(--os-win-solid) !important;
  }

  .os-window.os-window-notes {
    background: var(--os-notes-bg) !important;
  }

  .os-titlebar {
    min-height: 0;
    padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 12px;
    background: color-mix(in srgb, var(--os-win-solid) 92%, transparent) !important;
  }

  .os-window.os-window-notes .os-titlebar {
    background: var(--os-notes-title) !important;
  }

  .os-titlebar h2 {
    max-width: calc(100% - 180px);
  }

  .os-back {
    bottom: 50%;
    transform: translateY(50%);
  }

  .os-titlebar {
    position: relative;
  }

  .os-back {
    top: auto;
    bottom: 10px;
    transform: none;
  }

  .os-window-body {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  }

  .os-home-indicator {
    margin-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  }

  /* Skills on phones: name above its slider, no squeezing */
  .os-setting {
    grid-template-columns: 1fr 34px;
    grid-template-areas: "name value" "slider slider";
    gap: 8px 12px;
    padding: 12px 0;
  }

  .os-setting > span:first-child { grid-area: name; }
  .os-setting .os-slider { grid-area: slider; }
  .os-setting em { grid-area: value; }
}

/* Windows layer: directly on the page (not inside the desktop/home screen) */
.os-windows {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

@media (max-width: 760px) {
  /* phones: the app layer sits above everything except the lock screen and previews */
  .os-windows {
    z-index: 65;
  }

  .os-window {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
  }
}
