:root {
  --bg: #4c7391;
  --navy: #1c1f4a;
  --mint: #c4f6ee;
  --lav: #8f82be;
  --soft: #cfcbe8;
  --paper: #1c1f4a;
  --fg: #fff;
  --msoft: #cfcbe8;
  --acc: #c4f6ee;
  --line: rgba(143, 130, 190, 0.45);
  --lbl: #fff;
  --t: 68px;
  --pix: "Pixelify Sans", system-ui, sans-serif;
  --sans: "DM Sans", system-ui, sans-serif;
}
:root[data-theme="light"] {
  --bg: #b9d9ea;
  --paper: #fffaf0;
  --fg: #1c1f4a;
  --msoft: #4b4e78;
  --acc: #5b4a9e;
  --line: rgba(143, 130, 190, 0.6);
  --lbl: #1c1f4a;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg);
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.16) 1.5px,
    transparent 1.5px
  );
  background-size: 28px 28px;
  font: 17px/1.65 var(--sans);
  color: #fff;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
a {
  color: var(--acc);
}
:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
:root[data-theme="light"] :focus-visible {
  outline-color: var(--navy);
}
.i {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  flex: none;
}

/* icon tiles: desktop, dock and link icons share one design */
.icons .i,
.dock .i,
.links .i {
  --sh: var(--navy);
  width: var(--t);
  height: var(--t);
  padding: calc(var(--t) * 0.22);
  color: var(--navy);
  background: var(--c, var(--mint));
  border: 3px solid var(--navy);
  box-shadow:
    inset 3px 3px 0 rgba(255, 255, 255, 0.6),
    inset -3px -3px 0 rgba(28, 31, 74, 0.15),
    5px 5px 0 var(--sh);
  transition:
    transform 0.12s,
    box-shadow 0.12s;
}
.dock .i,
.links .i {
  --sh: var(--lav);
}
.icons button:hover .i,
.dock button:hover .i,
.links a:hover .i {
  transform: translate(-2px, -2px);
  box-shadow:
    inset 3px 3px 0 rgba(255, 255, 255, 0.6),
    inset -3px -3px 0 rgba(28, 31, 74, 0.15),
    7px 7px 0 var(--sh);
}
.icons button:active .i,
.dock button:active .i,
.links a:active .i {
  transform: translate(3px, 3px);
  box-shadow:
    inset 3px 3px 0 rgba(255, 255, 255, 0.6),
    2px 2px 0 var(--sh);
}
.icons button:nth-child(1),
.links a:nth-child(1) {
  --c: #f6c9a8;
}
.icons button:nth-child(2),
.links a:nth-child(2) {
  --c: #fbe9a8;
}
.icons button:nth-child(3),
.links a:nth-child(3) {
  --c: #c4f6ee;
}
.icons button:nth-child(4),
.links a:nth-child(4) {
  --c: #f6c6d8;
}
.dock #dock-music {
  --c: #b4f0c4;
}
.dock [data-open="w-notes"] {
  --c: #fbe9a8;
}
.dock [data-open="w-finder"] {
  --c: #b9dcf5;
}
.dock #theme {
  --c: #d8cef8;
}

.widget {
  position: absolute;
  left: 24px;
  top: 24px;
  width: 276px;
  padding: 16px;
  background: var(--navy);
  border: 2px solid var(--lav);
  box-shadow: 6px 6px 0 rgba(28, 31, 74, 0.35);
  z-index: 5;
}
.day {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--lav);
  margin-bottom: 14px;
}
.day strong {
  font: 500 21px var(--pix);
}
.day span {
  color: var(--mint);
  font-size: 14px;
}
#wr {
  color: var(--soft);
}
.song {
  display: flex;
  align-items: center;
  gap: 12px;
}
.art {
  width: 48px;
  height: 48px;
  flex: none;
  border: 2px solid var(--lav);
  border-radius: 50%;
  background:
    linear-gradient(
      135deg,
      transparent 42%,
      rgba(255, 255, 255, 0.22) 50%,
      transparent 58%
    ),
    radial-gradient(circle, #1c1f4a 0 3px, #f4a870 4px 11px, transparent 12px),
    repeating-radial-gradient(circle, #2e3270 0 2px, #23265a 2px 4px);
  animation: spin 6s linear infinite;
}
.meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.3;
}
.meta b {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meta span {
  font-size: 13px;
  color: var(--soft);
}
.eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
}
.eq i {
  width: 4px;
  background: var(--mint);
  height: 100%;
  transform-origin: bottom;
  animation: eq 0.9s ease-in-out infinite;
}
.eq i:nth-child(2) {
  animation-delay: -0.3s;
}
.eq i:nth-child(3) {
  animation-delay: -0.6s;
}
.eq i:nth-child(4) {
  animation-delay: -0.15s;
}
.prog {
  height: 6px;
  margin: 14px 0;
  background: rgba(143, 130, 190, 0.4);
}
.prog i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--mint);
  transition: width 1s linear;
}
.play {
  padding: 4px 20px;
  background: var(--mint);
  color: var(--navy);
  border: 2px solid var(--lav);
  font: 500 14px var(--pix);
}
.widget.paused * {
  animation-play-state: paused !important;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes eq {
  0%,
  100% {
    transform: scaleY(0.25);
  }
  50% {
    transform: scaleY(1);
  }
}
@keyframes prog {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.icons {
  position: absolute;
  left: 24px;
  top: 290px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 2;
}
.icons button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 128px;
  background: none;
  border: 0;
  padding: 0;
  font: 500 14px/1.25 var(--sans);
  text-align: center;
  color: var(--lbl);
}
:root:not([data-theme="light"]) .icons button {
  text-shadow: 0 1px 0 var(--navy);
}

.win {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: var(--mint);
  border: 2px solid var(--lav);
  box-shadow: 10px 10px 0 rgba(28, 31, 74, 0.35);
  color: var(--fg);
}
.win[hidden] {
  display: none;
}
.tb {
  flex: none;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 16px;
  background: var(--lav);
  color: var(--navy);
  font: 500 18px var(--pix);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.bt button {
  position: relative;
  width: 24px;
  height: 24px;
  padding: 0;
  background: #d9363e;
  border: 2px solid var(--navy);
}
.bt button::before,
.bt button::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 9px;
  width: 14px;
  height: 2px;
  background: #fff;
  transform: rotate(45deg);
}
.bt button::after {
  transform: rotate(-45deg);
}
.bt button:hover {
  background: #ef4b53;
}
.ad {
  flex: none;
  padding: 6px 10px;
  background: var(--mint);
}
.ad span {
  display: block;
  padding: 3px 14px;
  background: #fff;
  border: 2px solid var(--lav);
  color: var(--navy);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
}
.ad span::before {
  content: attr(data-url);
}
.bd {
  flex: 1;
  margin: 0 4px 4px;
  padding: 36px 48px;
  background: var(--paper);
  overflow-y: scroll;
  scrollbar-width: auto;
  scrollbar-color: var(--lav) var(--line);
}
.bd::-webkit-scrollbar {
  width: 18px;
}
.bd::-webkit-scrollbar-track {
  background: var(--line);
  border-left: 2px solid var(--lav);
}
.bd::-webkit-scrollbar-thumb {
  background: var(--lav);
  border: 3px solid var(--paper);
  min-height: 60px;
}
.bd::-webkit-scrollbar-thumb:hover {
  background: var(--acc);
}
.win:not(:has(.ad)) .bd {
  margin-top: 4px;
}
.win.more::after {
  content: "scroll for more \2193";
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 4px 16px;
  background: var(--mint);
  color: var(--navy);
  border: 2px solid var(--lav);
  box-shadow: 3px 3px 0 var(--navy);
  font: 500 14px var(--pix);
  pointer-events: none;
  animation: bob 1.4s ease-in-out infinite;
}
@keyframes bob {
  50% {
    transform: translate(-50%, -4px);
  }
}
.muted {
  color: var(--msoft);
  margin: 0 0 8px;
  font-size: 15px;
}
.role {
  margin: 0 0 16px;
  color: var(--acc);
  font-style: italic;
}
.bd p {
  max-width: 38em;
}
.e {
  margin: 0 0 28px;
}
.e:last-child {
  margin: 0;
}
.e h3 {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 14px;
  margin: 0;
  font: 500 22px/1.25 var(--pix);
}
.e h3 i {
  font: 400 14px var(--sans);
  color: var(--msoft);
  font-style: normal;
  padding-top: 6px;
}
.e p {
  margin: 4px 0 0;
  color: var(--msoft);
  font-size: 16px;
}
.e .role {
  margin: 2px 0 8px;
}
.e ul {
  margin: 0;
  padding-left: 20px;
  color: var(--msoft);
  font-size: 16px;
}
.e li {
  margin: 0 0 6px;
}
.e li b {
  color: var(--acc);
  font-weight: 500;
  margin-right: 6px;
}

.about {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.about > * {
  width: 100%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}
.hero {
  display: flex;
  gap: 44px;
  align-items: center;
}
.photo {
  position: relative;
  flex: none;
  width: 210px;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #f4a870, #8f82be);
  border: 3px solid var(--lav);
  box-shadow: 10px 10px 0 var(--lav);
  transform: rotate(-3deg);
}
.photo span {
  font: 600 78px var(--pix);
  color: var(--navy);
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hi {
  margin: 0;
  font: 500 22px var(--pix);
  color: var(--acc);
}
.intro h1 {
  margin: 2px 0 14px;
  font: 600 clamp(40px, 4.8vw, 68px)/1 var(--pix);
  text-shadow: 4px 4px 0 var(--lav);
}
.chip {
  display: inline-block;
  margin: 0 0 14px;
  padding: 3px 14px;
  background: var(--mint);
  color: var(--navy);
  border: 2px solid var(--lav);
  font: 500 16px var(--pix);
  transform: rotate(-1deg);
}
.bio {
  margin: 0;
  font-size: 18px;
}
.bio:empty {
  display: none;
}
.edu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.edu div {
  padding: 16px 20px;
  border: 2px solid var(--lav);
  box-shadow: 5px 5px 0 var(--line);
}
.edu h2 {
  margin: 0 0 2px;
  font: 500 19px/1.25 var(--pix);
}
.edu p {
  margin: 0;
  font-size: 15px;
  color: var(--msoft);
}
.edu span {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  color: var(--acc);
  font-weight: 500;
}
.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 34px;
  margin-top: auto;
  padding-top: 26px;
  border-top: 2px solid var(--lav);
}
.links a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  width: 92px;
  color: var(--fg);
  text-decoration: none;
  font: 500 14px var(--sans);
}

.dock {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  gap: 18px;
  padding: 14px 20px;
  background: var(--navy);
  border: 2px solid var(--lav);
  box-shadow: 6px 6px 0 rgba(28, 31, 74, 0.35);
  z-index: 9999;
}
.dock button {
  background: none;
  border: 0;
  padding: 0;
}
.th .moon {
  display: none;
}
:root[data-theme="light"] .th .moon {
  display: block;
}
:root[data-theme="light"] .th .sun {
  display: none;
}
.stars i {
  position: absolute;
  width: var(--s, 22px);
  height: var(--s, 22px);
  background: #fff;
  clip-path: polygon(
    50% 0,
    60% 40%,
    100% 50%,
    60% 60%,
    50% 100%,
    40% 60%,
    0 50%,
    40% 40%
  );
}

@media (max-height: 780px) {
  :root {
    --t: 54px;
  }
  .icons {
    top: 268px;
    gap: 10px;
  }
  .dock {
    padding: 10px 16px;
  }
}
@media (max-width: 760px) {
  :root {
    --t: 56px;
  }
  body {
    overflow: auto;
    height: auto;
    min-height: 100vh;
    padding-bottom: 120px;
  }
  .widget {
    position: static;
    width: auto;
    margin: 12px;
  }
  .icons {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-around;
    margin: 0 8px;
  }
  .icons button {
    width: 90px;
    font-size: 12px;
  }
  .win {
    position: fixed !important;
    left: 8px !important;
    top: 8px !important;
    width: calc(100vw - 16px) !important;
    height: calc(100vh - 110px) !important;
  }
  .tb {
    cursor: default;
  }
  .bd {
    padding: 22px;
  }
  .stars {
    display: none;
  }
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .edu {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
  }
}

/* ---------- extras: motion + detail ---------- */
html.booting .win {
  visibility: hidden;
  animation: unhide 0s 2.5s forwards;
}
@keyframes unhide {
  to {
    visibility: visible;
  }
}
#boot {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  transition: opacity 0.45s;
  animation: bootout 0.01s 3s forwards;
}
#boot.done {
  opacity: 0;
  pointer-events: none;
}
@keyframes bootout {
  to {
    opacity: 0;
    visibility: hidden;
  }
}
.bootbox {
  width: min(360px, 80vw);
  text-align: center;
  font: 500 26px var(--pix);
  color: var(--mint);
}
.bar {
  height: 24px;
  margin: 18px 0 10px;
  border: 3px solid var(--lav);
  padding: 3px;
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--mint);
  animation: load 1.2s steps(12) forwards;
}
@keyframes load {
  to {
    width: 100%;
  }
}
.bootbox small {
  display: block;
  font: 400 14px var(--sans);
  color: var(--soft);
}

.sky {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.cloud {
  position: absolute;
  left: 0;
  width: calc(150px * var(--s));
  height: calc(40px * var(--s));
  background: #fbe3ee;
  border: 2px solid #fff;
  border-radius: 99px;
  opacity: 0.85;
  animation: drift var(--d) linear infinite;
}
.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: #fbe3ee;
  border: 2px solid #fff;
  border-bottom: 0;
  border-radius: 99px 99px 0 0;
}
.cloud::before {
  left: 16%;
  bottom: calc(100% - 6px);
  width: 36%;
  height: 80%;
}
.cloud::after {
  left: 50%;
  bottom: calc(100% - 6px);
  width: 28%;
  height: 60%;
}
@keyframes drift {
  from {
    transform: translateX(-260px);
  }
  to {
    transform: translateX(100vw);
  }
}
:root[data-theme="light"] .cloud,
:root[data-theme="light"] .cloud::before,
:root[data-theme="light"] .cloud::after {
  background: #fff;
  border-color: #e6f2fa;
}
.stars i {
  animation: tw 3.2s ease-in-out infinite;
}
.stars i:nth-child(2) {
  animation-delay: -0.8s;
}
.stars i:nth-child(3) {
  animation-delay: -1.6s;
}
.stars i:nth-child(4) {
  animation-delay: -2.4s;
}
@keyframes tw {
  50% {
    opacity: 0.25;
    transform: scale(0.65) rotate(25deg);
  }
}
.spark {
  position: fixed;
  width: 9px;
  height: 9px;
  margin: -4px 0 0 -4px;
  pointer-events: none;
  z-index: 99998;
  clip-path: polygon(
    50% 0,
    60% 40%,
    100% 50%,
    60% 60%,
    50% 100%,
    40% 60%,
    0 50%,
    40% 40%
  );
  animation: spark 0.7s ease-out forwards;
}
@keyframes spark {
  from {
    opacity: 0.95;
  }
  to {
    opacity: 0;
    transform: translate(var(--dx), 22px) scale(0.2) rotate(90deg);
  }
}

.win:not([hidden]) {
  animation: winin 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}
.win.closing {
  animation: winout 0.15s ease-in both;
}
@keyframes winin {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes winout {
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
}
.tb {
  transition:
    background 0.2s,
    color 0.2s;
}
.win.inactive .tb {
  background: #6e668f;
  color: #d9d4ee;
}
.win.inactive {
  box-shadow: 6px 6px 0 rgba(28, 31, 74, 0.25);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.win:not([hidden]) .about > *,
.win:not([hidden]) .e,
.win:not([hidden]) .stats {
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
.about > :nth-child(2) {
  animation-delay: 0.12s !important;
}
.about > :nth-child(3) {
  animation-delay: 0.24s !important;
}
.stats {
  animation-delay: 0.05s !important;
}
.e:nth-child(2) {
  animation-delay: 0.1s !important;
}
.e:nth-child(3) {
  animation-delay: 0.2s !important;
}
.e:nth-child(4) {
  animation-delay: 0.3s !important;
}
.e:nth-child(5) {
  animation-delay: 0.4s !important;
}
.e:nth-child(6) {
  animation-delay: 0.5s !important;
}
.e:nth-child(7) {
  animation-delay: 0.6s !important;
}
.photo {
  animation: float 5s ease-in-out infinite;
}
@keyframes float {
  0%,
  100% {
    transform: rotate(-3deg) translateY(0);
  }
  50% {
    transform: rotate(-1.5deg) translateY(-9px);
  }
}
.edu div {
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.edu div:hover {
  transform: translate(-3px, -3px);
  box-shadow: 8px 8px 0 var(--line);
}
.chip {
  transition: transform 0.15s;
}
.chip:hover {
  transform: rotate(1deg) scale(1.04);
}

.bd .e {
  position: relative;
  margin: 0 0 0 8px;
  padding: 0 0 32px 32px;
  border-left: 2px solid var(--lav);
}
.bd .e:last-child {
  padding-bottom: 0;
  border-left-color: transparent;
}
.bd .e::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 7px;
  width: 16px;
  height: 16px;
  background: var(--acc);
  border: 3px solid var(--paper);
  outline: 2px solid var(--lav);
  transition: background 0.15s;
}
.bd .e:hover::before {
  background: #fff;
}
.e h3 {
  transition: color 0.15s;
}
.e:hover h3 {
  color: var(--acc);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 0 0 36px;
}
.stats div {
  padding: 14px 16px;
  border: 2px solid var(--lav);
  box-shadow: 5px 5px 0 var(--line);
}
.stats b {
  display: block;
  font: 600 36px/1.1 var(--pix);
  color: var(--acc);
}
.stats span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--msoft);
}

.ctl {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#tm {
  font: 500 13px var(--pix);
  color: var(--soft);
}
.dock button {
  position: relative;
}
.dock button::before {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 18px);
  transform: translate(-50%, 6px);
  padding: 3px 12px;
  background: var(--mint);
  color: var(--navy);
  border: 2px solid var(--lav);
  font: 500 13px var(--pix);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.15s,
    transform 0.15s;
}
.dock button:hover::before,
.dock button:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, 0);
}
.dock button.on::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -12px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  background: var(--mint);
}
.clk {
  align-self: center;
  padding-left: 20px;
  border-left: 2px solid var(--lav);
  font: 500 17px var(--pix);
  color: var(--mint);
  white-space: nowrap;
}
.foot {
  position: absolute;
  right: 24px;
  bottom: 20px;
  margin: 0;
  font-size: 13px;
  color: var(--lbl);
  opacity: 0.7;
}
@media (max-width: 760px) {
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .foot,
  .clk {
    display: none;
  }
  .sky .cloud {
    opacity: 0.6;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
