@import url("https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700&display=swap");

:root {
  /* Colors */
  --bg: #1f1334;
  --desktop: #24183b;
  --panel: #2d2147;
  --panel-raised: #392b55;
  --panel-hover: #46345f;
  --accent: #c894f9;
  --accent-soft: #a7a5f5;
  --accent-blue: #86b8f6;
  --accent-pink: #f29bc8;
  --text: #f7f3ff;
  --muted: #b9adc9;
  --line: #514267;
  --taskbar: #171022;

  /* Typography */
  --font-family: "Lexend", sans-serif;
  --text-2xs: 10px;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 13px;
  --text-md: 14px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 22px;
  --text-3xl: 24px;
  --text-hero: clamp(24px, 2.6vw, 32px);
  --line-copy: 1.9;
  --line-role: 1.55;
  --line-heading: 1.25;

  /* Icons */
  --icon-sm: 16px;
  --icon-md: 18px;
  --icon-lg: 22px;

  /* Window shell */
  --taskbar-height: 68px;
  --titlebar-height: 46px;
  --statusbar-py: 8px;
  --statusbar-px: 12px;
  --content-padding: 24px;
  --content-padding-mobile: 18px;
  --content-padding-small: 16px;
  --window-min-width: 300px;
  --window-min-height: 200px;
  --radius-window: 0px;
  --radius-control: 0px;
  --radius-small: 0px;
  --maximized-inset: 16px;

  /* Window controls */
  --control-w: 28px;
  --control-h: 27px;

  /* Taskbar */
  --taskbar-padding-x: 18px;
  --taskbar-start-size: 40px;
  --taskbar-app-size: 46px;
  --taskbar-divider-height: 30px;
  --taskbar-gap: 8px;
  --tray-font: 12px;
  --tray-icon: 14px;

  /* Desktop note */
  --note-mark-size: 48px;
  --note-mark-radius: 13px;

  /* Profile */
  --profile-size: 108px;
  --profile-radius: 24px;
  --profile-gap: 20px;
  --profile-initial: 28px;
  --status-dot: 7px;

  /* Projects */
  --project-icon-size: 44px;
  --project-icon-radius: 9px;
  --project-item-padding: 13px 11px;
  --project-item-gap: 13px;
  --project-copy-gap: 5px;

  /* Contact */
  --contact-symbol-size: 44px;
  --contact-symbol-radius: 11px;
  --social-size: 32px;
  --social-radius: 8px;
  --social-gap: 9px;

  /* Small components */
  --tag-py: 7px;
  --tag-px: 10px;
  --tag-gap: 8px;
  --tag-radius: 6px;
  --email-py: 10px;
  --email-px: 11px;
  --email-radius: 7px;

  --shadow: 0 18px 48px rgba(0, 0, 0, 0.3);

  font-family: var(--font-family);
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  overflow: hidden;
  background: var(--desktop);
  font-size: var(--text-sm);
}

button,
a { font: inherit; }

button { color: inherit; }
a { color: inherit; text-decoration: none; }

.desktop {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--taskbar-height));
  min-height: 500px;
  overflow: hidden;
  background-color: var(--desktop);
  background-image: none;
}

.desktop-note {
  position: absolute;
  left: 28px;
  top: 26px;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: var(--text-sm);
  letter-spacing: 0.14em;
  font-weight: 600;
  z-index: 0;
}

.note-mark {
  display: grid;
  place-items: center;
  width: var(--note-mark-size);
  height: var(--note-mark-size);
  margin-bottom: 5px;
  border: 1px solid #6b5689;
  border-radius: var(--note-mark-radius);
  background: var(--panel);
  color: var(--accent);
  font-size: var(--icon-lg);
}

.desktop-note small {
  font-size: var(--text-xs);
  letter-spacing: 0.03em;
  font-weight: 400;
  color: #9385aa;
}

/* ---------------------------------------------------------------- */
/* Window shell                                                      */
/* ---------------------------------------------------------------- */

.window {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: var(--window-min-width);
  min-height: var(--window-min-height);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-window);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: opacity 0.16s ease, transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.window:focus-within,
.window.focused {
  border-color: #8064a4;
}

.window.focused {
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.42);
}

.window.is-hidden { display: none; }

.window.is-maximized {
  inset: var(--maximized-inset) !important;
  width: auto !important;
  height: auto !important;
}

.window.is-dragging,
.window.is-resizing {
  transition: none;
}

body.is-dragging,
body.is-resizing {
  user-select: none;
  -webkit-user-select: none;
}

.window-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--titlebar-height);
  padding: 0 10px 0 15px;
  background: #45335f;
  border-bottom: 1px solid #5a4674;
  user-select: none;
  cursor: grab;
}

.window.is-dragging .window-titlebar {
  cursor: grabbing;
}

.window-controls {
  position: relative;
  z-index: 6;
  display: flex;
  gap: 6px;
}

.window-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: var(--text-base);
  font-weight: 500;
}

.window-label > i {
  color: var(--accent);
  font-size: var(--icon-sm);
}

.window-label span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.window-control {
  display: grid;
  place-items: center;
  width: var(--control-w);
  height: var(--control-h);
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: #d4c9e5;
  font-size: var(--text-sm);
  cursor: pointer;
}

.window-control:hover {
  background: #5a4674;
  color: white;
}

.window-control.close:hover {
  background: #a94769;
}

.window-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: var(--content-padding);
  scrollbar-width: thin;
  scrollbar-color: #6c5884 transparent;
}

.window-statusbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: var(--statusbar-py) var(--statusbar-px);
  border-top: 1px solid var(--line);
  background: #281d40;
  color: #9f91b4;
  font-size: var(--text-2xs);
  letter-spacing: 0.08em;
}

.window-statusbar i {
  font-size: 8px;
  color: #89d5ae;
  margin-right: 4px;
}

/* ---------------------------------------------------------------- */
/* Resize handles                                                    */
/* ---------------------------------------------------------------- */

.resize-handle {
  position: absolute;
  z-index: 5;
}

.resize-handle[data-resize="n"] {
  top: 0;
  left: 10px;
  right: 10px;
  height: 6px;
  cursor: ns-resize;
}

.resize-handle[data-resize="s"] {
  bottom: 0;
  left: 10px;
  right: 10px;
  height: 6px;
  cursor: ns-resize;
}

.resize-handle[data-resize="e"] {
  top: 10px;
  bottom: 10px;
  right: 0;
  width: 6px;
  cursor: ew-resize;
}

.resize-handle[data-resize="w"] {
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 6px;
  cursor: ew-resize;
}

.resize-handle[data-resize="ne"] {
  top: 0;
  right: 0;
  width: 12px;
  height: 12px;
  cursor: nesw-resize;
}

.resize-handle[data-resize="nw"] {
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  cursor: nwse-resize;
}

.resize-handle[data-resize="se"] {
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  cursor: nwse-resize;
}

.resize-handle[data-resize="sw"] {
  bottom: 0;
  left: 0;
  width: 12px;
  height: 12px;
  cursor: nesw-resize;
}

.desktop:not(.is-stacked) .window-titlebar,
.desktop:not(.is-stacked) .resize-handle {
  touch-action: none;
}

/* ---------------------------------------------------------------- */
/* Content                                                           */
/* ---------------------------------------------------------------- */

.profile-row {
  display: flex;
  align-items: center;
  gap: var(--profile-gap);
}

.profile-picture {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 var(--profile-size);
  width: var(--profile-size);
  height: var(--profile-size);
  overflow: hidden;
  border: 2px solid #7c649d;
  border-radius: var(--profile-radius);
  background: #49345f;
}

.profile-picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-fallback {
  display: none;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #f3e7ff;
  font-size: var(--profile-initial);
  font-weight: 600;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.17em;
}

.profile-intro h1 {
  margin: 0;
  font-size: var(--text-hero);
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.period { color: var(--accent-pink); }

.role {
  margin: 7px 0 12px;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: var(--line-role);
}

.status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #a8d8bd;
  font-size: var(--text-2xs);
}

.status span {
  width: var(--status-dot);
  height: var(--status-dot);
  border-radius: 50%;
  background: #83d7a8;
  box-shadow: 0 0 0 3px rgba(131, 215, 168, 0.12);
}

.rule {
  height: 1px;
  margin: 24px 0 21px;
  background: var(--line);
}

h2 {
  margin: 0 0 10px;
  font-size: var(--text-lg);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: var(--line-heading);
}

.body-copy {
  margin: 0;
  color: #c7bdd5;
  font-size: var(--text-sm);
  line-height: var(--line-copy);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tag-gap);
  margin-top: 17px;
}

.tag-list span {
  padding: var(--tag-py) var(--tag-px);
  border: 1px solid #59466f;
  border-radius: var(--tag-radius);
  background: #332649;
  color: #d5c5e8;
  font-size: var(--text-2xs);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-heading .eyebrow {
  margin-bottom: 5px;
}

.section-heading h2 {
  margin: 0;
  font-size: var(--text-2xl);
}

.count-label {
  margin-bottom: 3px;
  color: #a79ab9;
  font-size: var(--text-2xs);
  letter-spacing: 0.1em;
}

.project-item {
  display: flex;
  align-items: center;
  gap: var(--project-item-gap);
  padding: var(--project-item-padding);
  margin-bottom: 9px;
  border: 1px solid #4b3a61;
  border-radius: var(--radius-small);
  background: #332649;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.project-item:hover {
  background: #403054;
  border-color: #8065a0;
  transform: translateX(2px);
}

.project-icon {
  display: grid;
  place-items: center;
  flex: 0 0 var(--project-icon-size);
  width: var(--project-icon-size);
  height: var(--project-icon-size);
  border-radius: var(--project-icon-radius);
  font-size: var(--icon-md);
}

.project-icon.purple {
  color: #e0c0ff;
  background: #594076;
}

.project-icon.blue {
  color: #b9d9ff;
  background: #344c70;
}

.project-icon.pink {
  color: #ffd0e5;
  background: #70405e;
}

.project-copy {
  display: grid;
  gap: var(--project-copy-gap);
  min-width: 0;
}

.project-copy strong {
  font-size: var(--text-sm);
  font-weight: 500;
}

.project-copy small {
  overflow: hidden;
  color: #afa1c2;
  font-size: var(--text-2xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-arrow {
  margin-left: auto;
  color: #a99abf;
  font-size: var(--text-md);
}

.hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  color: #9f91b3;
  font-size: var(--text-2xs);
}

.contact-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.contact-symbol {
  display: grid;
  place-items: center;
  width: var(--contact-symbol-size);
  height: var(--contact-symbol-size);
  margin-bottom: 16px;
  border: 1px solid #6d5688;
  border-radius: var(--contact-symbol-radius);
  background: #45335f;
  color: var(--accent-pink);
  font-size: var(--icon-md);
}

.contact-content h2 {
  margin-bottom: 10px;
  font-size: var(--text-3xl);
  line-height: var(--line-heading);
}

.contact-content .body-copy {
  max-width: 300px;
}

.email-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  margin-top: 16px;
  padding: var(--email-py) var(--email-px);
  border: 1px solid #6a5484;
  border-radius: var(--email-radius);
  background: #392b52;
  color: #e2caff;
  font-size: var(--text-xs);
}

.email-link:hover {
  background: #4b3769;
}

.email-link .bi-arrow-up-right {
  margin-left: 3px;
}

.social-links {
  display: flex;
  gap: var(--social-gap);
  margin-top: 14px;
}

.social-links a {
  display: grid;
  place-items: center;
  width: var(--social-size);
  height: var(--social-size);
  border: 1px solid #514065;
  border-radius: var(--social-radius);
  background: #332649;
  color: #c4b4d7;
  font-size: var(--text-md);
}

.social-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.desktop-hint {
  position: absolute;
  right: 22px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #877998;
  font-size: var(--text-xs);
  pointer-events: none;
}

/* ---------------------------------------------------------------- */
/* Taskbar                                                           */
/* ---------------------------------------------------------------- */

.taskbar {
  position: fixed;
  z-index: 1000;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  height: var(--taskbar-height);
  padding: 0 var(--taskbar-padding-x);
  border-top: 1px solid #392b4b;
  background: var(--taskbar);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.15);
}

.taskbar-start,
.taskbar-app {
  display: grid;
  place-items: center;
  border: 0;
  cursor: pointer;
}

.taskbar-start {
  width: var(--taskbar-start-size);
  height: var(--taskbar-start-size);
  border-radius: 10px;
  background: #3a2b50;
  color: var(--accent);
  font-size: var(--icon-lg);
}

.taskbar-start:hover {
  background: #4a3665;
}

.taskbar-divider {
  width: 1px;
  height: var(--taskbar-divider-height);
  margin: 0 14px;
  background: #40334f;
}

.taskbar-apps {
  display: flex;
  align-items: center;
  gap: var(--taskbar-gap);
  height: 100%;
}

.taskbar-app {
  position: relative;
  width: var(--taskbar-app-size);
  height: var(--taskbar-app-size);
  border-radius: var(--radius-small);
  background: transparent;
  color: #b9accb;
  font-size: var(--icon-md);
}

.taskbar-app:hover,
.taskbar-app.active:hover {
  background: #30243f;
  color: white;
}

.taskbar-app.active {
  color: #e4c9ff;
  background: #2a2038;
}

.taskbar-app > span {
  position: absolute;
  bottom: 3px;
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: #9c79c7;
  opacity: 0;
}

.taskbar-app.active > span {
  opacity: 1;
}

.taskbar-app.minimized {
  background: transparent;
  color: #9685aa;
}

.taskbar-spacer { flex: 1; }

.taskbar-tray {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 5px 0 12px;
  color: #d7cde3;
  font-size: var(--tray-font);
}

.tray-status {
  display: flex;
  gap: 9px;
  color: #b9accb;
  font-size: var(--tray-icon);
}

/* ---------------------------------------------------------------- */
/* Responsive                                                        */
/* ---------------------------------------------------------------- */

@media (max-width: 900px) {
  :root {
    --taskbar-height: 64px;
    --content-padding: var(--content-padding-mobile);
    --maximized-inset: 12px;
  }

  body {
    overflow: auto;
  }

  .desktop {
    height: auto;
    min-height: calc(100vh - var(--taskbar-height));
    overflow: visible;
    padding: 88px 14px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .desktop-note {
    top: 17px;
    left: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .note-mark {
    width: 38px;
    height: 38px;
    margin: 0;
    border-radius: 10px;
    font-size: var(--icon-md);
  }

  .desktop-note small { display: none; }

  .window {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    min-height: 0;
  }

  .window.is-maximized {
    position: fixed;
    z-index: 999;
    inset: var(--maximized-inset) 10px calc(var(--taskbar-height) + 10px) !important;
  }

  .window.is-hidden { display: none; }

  .resize-handle { display: none; }

  .window-titlebar { cursor: default; }

  .window-content {
    padding: var(--content-padding);
  }

  .desktop-hint { display: none; }

  .taskbar {
    height: var(--taskbar-height);
    padding: 0 10px;
  }

  .taskbar-app {
    width: calc(var(--taskbar-app-size) - 4px);
    height: calc(var(--taskbar-app-size) - 3px);
  }

  .taskbar-tray {
    gap: 8px;
    font-size: var(--text-2xs);
  }
}

@media (max-width: 430px) {
  .profile-row {
    align-items: flex-start;
    gap: 14px;
  }

  .profile-picture {
    flex-basis: calc(var(--profile-size) * 0.72);
    width: calc(var(--profile-size) * 0.72);
    height: calc(var(--profile-size) * 0.72);
    border-radius: calc(var(--profile-radius) * 0.72);
  }

  .profile-intro h1 {
    font-size: var(--text-2xl);
  }

  .role {
    font-size: var(--text-xs);
  }

  .window-content {
    padding: var(--content-padding-small);
  }

  .taskbar-divider {
    margin: 0 9px;
  }

  .tray-status { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}