/* ── Bartosz Andrzejak — Desktop OS Portfolio ── */

:root {
  --bg-deep: #0a0e14;
  --bg-panel: #111820;
  --bg-panel-solid: #111820;
  --bg-titlebar: #161e28;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8eef6;
  --text-dim: #8b9aab;
  --text-muted: #5c6b7a;
  --accent: #5b9fff;
  --accent-soft: rgba(91, 159, 255, 0.14);
  --accent-glow: rgba(91, 159, 255, 0.3);
  --amber: #f0b429;
  --amber-soft: rgba(240, 180, 41, 0.15);
  --green: #6dda8a;
  --red: #ff6b6b;
  --yellow: #f5c542;
  --blue: #5b9fff;
  --font-ui: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius-window: 8px;
  --radius-sm: 8px;
  --shadow-window: 0 18px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --taskbar-h: 48px;
  --menubar-h: 36px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
}

/* ── Boot ── */
#boot {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #12161c;
  overflow: hidden;
  transition: opacity 0.5s var(--ease), visibility 0.5s;
}

#boot.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#boot::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse 42% 36% at 50% 48%, #12161c 15%, transparent 70%);
  pointer-events: none;
}

.boot-log {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 18px 22px;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: var(--font-mono);
  font-size: clamp(0.58rem, 1.3vw, 0.72rem);
  line-height: 1.5;
  color: rgba(160, 175, 195, 0.55);
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: none;
  pointer-events: none;
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 10%,
    black 62%,
    transparent 88%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 10%,
    black 62%,
    transparent 88%
  );
  opacity: 0.85;
}

.boot-log::-webkit-scrollbar {
  display: none;
}

.boot-log .ok-tag {
  color: rgba(109, 218, 138, 0.7);
  font-weight: 600;
}

.boot-log .wait-tag {
  color: rgba(91, 159, 255, 0.75);
  font-weight: 600;
}

.boot-center {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
  animation: bootFadeIn 0.55s var(--ease) both;
}

.boot-logo-wrap {
  position: relative;
  margin-bottom: 22px;
  display: grid;
  place-items: center;
}

.boot-logo-wrap::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 74%;
  width: 52px;
  height: 16px;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at center,
    rgba(70, 140, 255, 0.5) 0%,
    rgba(50, 110, 240, 0.18) 50%,
    transparent 75%
  );
  filter: blur(6px);
  pointer-events: none;
  z-index: 0;
}

.boot-logo {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow:
    0 0 0 1px rgba(100, 160, 255, 0.22),
    0 8px 22px rgba(0, 0, 0, 0.4);
}

.boot-brand {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.boot-status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: rgba(170, 190, 220, 0.8);
  letter-spacing: 0.04em;
  min-height: 1.2em;
  transition: opacity 0.2s;
}

.boot-bar {
  width: min(200px, 48vw);
  height: 2px;
  margin-top: 22px;
  background: rgba(100, 150, 255, 0.14);
  border-radius: 99px;
  overflow: hidden;
}

.boot-bar-fill {
  height: 100%;
  width: 0%;
  background: #5b9fff;
  border-radius: 99px;
  transition: width 0.25s ease;
}

@keyframes bootFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Desktop ── */
#desktop {
  position: fixed;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}

#desktop.ready {
  opacity: 1;
}

.wallpaper {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 30% 22% at 16% 10%, rgba(91, 159, 255, 0.08), transparent 72%),
    radial-gradient(ellipse 26% 20% at 90% 85%, rgba(91, 159, 255, 0.05), transparent 72%),
    #0a0e14;
  z-index: 0;
}

.wallpaper::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../background.png");
  background-size: cover;
  background-position: center;
  opacity: 0.22;
  filter: saturate(0.7) brightness(0.55);
  mix-blend-mode: luminosity;
}

.wallpaper-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 48% 42% at 50% 40%, black, transparent);
  pointer-events: none;
}

/* Menubar */
.menubar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--menubar-h);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: rgba(8, 12, 18, 0.92);
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
}

.menubar-left,
.menubar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.menubar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.menubar-brand img {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  object-fit: cover;
}

.menubar-item {
  color: var(--text-dim);
  transition: color 0.15s;
}

.menubar-item:hover {
  color: var(--text);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: statusPulse 2.4s ease-in-out infinite;
}

@keyframes statusPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

#clock {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Desktop icons */
.desktop-icons {
  position: absolute;
  top: calc(var(--menubar-h) + 20px);
  left: 18px;
  z-index: 10;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 4px;
}

.desk-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 88px;
}

.desk-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, transform 0.2s var(--ease);
  color: inherit;
  text-decoration: none;
}

a.desk-icon:hover {
  text-decoration: none;
  color: inherit;
}

.desk-icon:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
}

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

.desk-icon-glyph {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  font-family: var(--font-mono);
  font-weight: 600;
  background: #151c26;
  border: 1.5px solid rgba(140, 150, 165, 0.35);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  color: var(--text-dim);
  overflow: hidden;
}

.desk-icon-glyph.desk-icon-img {
  padding: 0;
  border-color: rgba(142, 176, 194, 0.55);
  background: #1c1d22;
}

.desk-icon-glyph.desk-icon-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.desk-icon[data-external="ashka"]:hover .desk-icon-glyph {
  border-color: rgba(142, 176, 194, 0.85);
}

/* Terminal — blue */
.desk-icon[data-app="terminal"] .desk-icon-glyph {
  background: rgba(91, 159, 255, 0.12);
  color: #5b9fff;
  border-color: rgba(91, 159, 255, 0.65);
}

/* Files — amber */
.desk-icon[data-app="files"] .desk-icon-glyph {
  background: rgba(240, 180, 41, 0.12);
  color: #f0b429;
  border-color: rgba(240, 180, 41, 0.65);
}

/* Projects — green */
.desk-icon[data-app="projects"] .desk-icon-glyph {
  background: rgba(109, 218, 138, 0.12);
  color: #6dda8a;
  border-color: rgba(109, 218, 138, 0.65);
}

/* About — violet */
.desk-icon[data-app="about"] .desk-icon-glyph {
  background: rgba(199, 146, 234, 0.12);
  color: #c792ea;
  border-color: rgba(199, 146, 234, 0.65);
}

/* Contact — blue */
.desk-icon[data-app="contact"] .desk-icon-glyph {
  background: rgba(91, 159, 255, 0.12);
  color: #5b9fff;
  border-color: rgba(91, 159, 255, 0.65);
}

.desk-icon-label {
  font-size: 0.68rem;
  text-align: center;
  line-height: 1.25;
  color: var(--text);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
  max-width: 80px;
}

/* Desktop widgets */
.desktop-widgets {
  position: absolute;
  top: calc(var(--menubar-h) + 20px);
  right: 18px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(260px, 32vw);
  pointer-events: none;
}

.widget {
  pointer-events: auto;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(14, 18, 26, 0.78);
  border: 1px solid var(--border);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.widget-clock .widget-time {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 6px;
}

.widget-clock .widget-date {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.widget-status .widget-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 10px;
}

.widget-status .widget-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  margin-bottom: 10px;
}

.widget-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.widget-chip {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  border: 1px solid rgba(91, 159, 255, 0.25);
  color: var(--accent);
}

.widget-note .widget-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.widget-note p {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.widget-note kbd {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--accent);
}

/* File manager */
.files-app {
  display: grid;
  grid-template-columns: 160px 1fr;
  height: 100%;
  min-height: 0;
}

.files-sidebar {
  border-right: 1px solid var(--border);
  padding: 12px 10px;
  background: rgba(0, 0, 0, 0.18);
  overflow: auto;
}

.files-side-item {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}

.files-side-item:hover,
.files-side-item.active {
  background: rgba(91, 159, 255, 0.12);
  color: var(--text);
}

.files-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.files-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.files-toolbar .path {
  color: var(--accent);
}

.files-grid {
  flex: 1;
  overflow: auto;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  align-content: start;
}

.files-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--text);
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}

.files-item:hover,
.files-item.selected {
  background: rgba(91, 159, 255, 0.1);
  border-color: rgba(91, 159, 255, 0.28);
}

.files-item-ico {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}

.files-item.folder .files-item-ico {
  background: rgba(240, 180, 41, 0.12);
  border-color: rgba(240, 180, 41, 0.35);
  color: #f0b429;
}

.files-item-name {
  font-size: 0.72rem;
  line-height: 1.3;
  word-break: break-word;
}

.files-preview {
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.5;
  min-height: 64px;
  background: rgba(0, 0, 0, 0.15);
}

.files-preview strong {
  color: var(--text);
  display: block;
  margin-bottom: 4px;
  font-size: 0.82rem;
}

.window[data-app="files"] .window-body {
  overflow: hidden;
}

.window[data-app="doom"] .window-body {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
}

.doom-app {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
}

.doom-desktop {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.doom-desktop[hidden],
.doom-mobile[hidden],
.doom-mobile-card[hidden],
.doom-mobile-embed-wrap[hidden] {
  display: none !important;
}

.doom-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 80, 60, 0.25);
  background: #121212;
  flex-shrink: 0;
}

.doom-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: #ff5040;
}

.doom-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doom-stage {
  flex: 1;
  min-height: 0;
  width: 100%;
  position: relative;
  background: #000;
}

.doom-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.doom-loading {
  position: absolute;
  inset: 36px 0 0;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #ff5040;
  background: #0a0a0a;
  z-index: 2;
  pointer-events: none;
}

.doom-loading.hidden {
  display: none;
}

.doom-loading.error {
  color: #ff8a7a;
}

/* Mobile DOOM launcher */
.doom-mobile {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255, 80, 60, 0.18), transparent 60%),
    #0a0a0a;
}

.doom-mobile-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 22px;
  gap: 10px;
}

.doom-mobile-mark {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 2rem;
  color: #ff5040;
  background: rgba(255, 80, 60, 0.12);
  border: 1.5px solid rgba(255, 80, 60, 0.55);
  margin-bottom: 8px;
}

.doom-mobile-card h2 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.doom-mobile-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ff5040;
}

.doom-mobile-copy {
  max-width: 32ch;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 6px 0 10px;
}

.doom-mobile-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: min(100%, 240px);
  padding: 12px 22px;
  border-radius: 12px;
  background: #ff5040;
  color: #140606;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  border: none;
}

.doom-mobile-play:hover {
  text-decoration: none;
  color: #140606;
  filter: brightness(1.05);
}

.doom-mobile-embed {
  min-height: 44px;
  min-width: min(100%, 240px);
  padding: 10px 18px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 600;
}

.doom-mobile-embed:hover {
  border-color: rgba(255, 80, 60, 0.45);
  color: var(--text);
}

.doom-mobile-tip {
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.doom-mobile-embed-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.doom-mobile-back {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.files-item.is-hidden {
  opacity: 0.55;
}

.files-item.is-hidden:hover {
  opacity: 0.9;
}

.files-item.is-doom .files-item-ico {
  background: rgba(255, 80, 60, 0.14);
  border-color: rgba(255, 80, 60, 0.5);
  color: #ff5040;
  font-family: var(--font-mono);
  font-weight: 700;
}

.files-item.is-hidden.folder .files-item-ico {
  background: rgba(140, 150, 165, 0.08);
  border-color: rgba(140, 150, 165, 0.25);
  color: var(--text-muted);
}

/* Windows layer */
#windows {
  position: absolute;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  padding-top: var(--menubar-h);
  padding-bottom: calc(var(--taskbar-h) + 8px);
}

.window {
  position: absolute;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  min-width: 280px;
  min-height: 200px;
  background: var(--bg-panel-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-window);
  box-shadow: var(--shadow-window);
  overflow: visible;
  opacity: 0;
  transform: scale(0.96) translateY(8px);
  transition:
    opacity 0.2s var(--ease),
    transform 0.2s var(--ease),
    box-shadow 0.2s;
  will-change: transform, opacity;
}

.window.resizing {
  transition: none;
  user-select: none;
}

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

.window.focused {
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(91, 159, 255, 0.28);
}

.window.minimized {
  opacity: 0;
  transform: scale(0.7) translateY(80px);
  pointer-events: none;
}

/* Resize handles */
.resize-handle {
  position: absolute;
  z-index: 5;
  opacity: 0;
}

.window.focused .resize-handle {
  opacity: 1;
}

.resize-handle.n {
  top: 0;
  left: 10px;
  right: 10px;
  height: 5px;
  cursor: ns-resize;
}
.resize-handle.s {
  bottom: 0;
  left: 10px;
  right: 10px;
  height: 5px;
  cursor: ns-resize;
}
.resize-handle.e {
  right: 0;
  top: 10px;
  bottom: 10px;
  width: 5px;
  cursor: ew-resize;
}
.resize-handle.w {
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 5px;
  cursor: ew-resize;
}
.resize-handle.ne {
  top: 0;
  right: 0;
  width: 12px;
  height: 12px;
  cursor: nesw-resize;
}
.resize-handle.nw {
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  cursor: nwse-resize;
}
.resize-handle.se {
  bottom: 0;
  right: 0;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
}
.resize-handle.sw {
  bottom: 0;
  left: 0;
  width: 12px;
  height: 12px;
  cursor: nesw-resize;
}

.window-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 6px 0 10px;
  background: var(--bg-titlebar);
  border-bottom: 1px solid var(--border);
  cursor: grab;
  flex-shrink: 0;
  border-radius: var(--radius-window) var(--radius-window) 0 0;
}

.window-body {
  flex: 1;
  overflow: auto;
  min-height: 0;
  background: var(--bg-panel-solid);
  border-radius: 0 0 var(--radius-window) var(--radius-window);
}

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

.window-controls {
  display: flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

.win-btn.close {
  width: 28px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: rgba(255, 170, 170, 0.85);
  background: rgba(255, 107, 107, 0.16);
  transition: background 0.15s, color 0.15s;
}

.win-btn.close svg {
  width: 11px;
  height: 11px;
  display: block;
}

.win-btn.close:hover {
  background: rgba(255, 107, 107, 0.32);
  color: #ffc4c4;
  filter: none;
  transform: none;
}

.window-title {
  flex: 1;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}

.window-title .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.window[data-app="terminal"] .window-body {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Terminal (xterm.js) */
.terminal {
  flex: 1;
  min-height: 0;
  width: 100%;
  padding: 8px 10px 10px;
  background: #080c12;
  overflow: hidden;
}

.terminal .xterm {
  height: 100%;
}

.terminal .xterm-viewport {
  overflow-y: auto !important;
}

/* Content panes */
.pane {
  padding: 22px 24px 28px;
  height: 100%;
  overflow: auto;
}

.pane-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.pane-avatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.pane-hero h2 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.pane-hero p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.badge {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.badge.live {
  background: var(--accent-soft);
  border-color: rgba(91, 159, 255, 0.35);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.section-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 22px 0 12px;
}

.prose {
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.65;
  max-width: 52ch;
}

.skills-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.skill:hover {
  border-color: rgba(91, 159, 255, 0.4);
  color: var(--accent);
  background: var(--accent-soft);
}

.skill.core {
  border-color: rgba(91, 159, 255, 0.3);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Projects grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  text-align: left;
  transition:
    border-color 0.2s,
    transform 0.25s var(--ease),
    background 0.2s,
    box-shadow 0.25s;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.project-card:hover {
  border-color: rgba(91, 159, 255, 0.4);
  background: rgba(91, 159, 255, 0.06);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  text-decoration: none;
}

.project-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.project-glyph {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}

.project-ext {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.15s;
}

.project-card:hover .project-ext {
  color: var(--accent);
}

.project-name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.project-url {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent);
  opacity: 0.85;
}

.project-desc {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-dim);
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.project-tag {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Contact app */
.contact-app {
  height: 100%;
  overflow: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-panel-solid);
  container-type: inline-size;
  container-name: contact;
}

.contact-hero {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(91, 159, 255, 0.28);
  background: rgba(91, 159, 255, 0.07);
}

.contact-avatar {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  border: 1.5px solid rgba(91, 159, 255, 0.45);
  flex-shrink: 0;
}

.contact-hero-text {
  min-width: 0;
}

.contact-kicker {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5b9fff;
  margin-bottom: 6px;
  font-weight: 600;
}

.contact-hero-text h2 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.contact-lead {
  color: var(--text-dim);
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 12px;
  max-width: 38ch;
}

.contact-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.contact-pill {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.contact-pill.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(109, 218, 138, 0.1);
  border-color: rgba(109, 218, 138, 0.35);
  color: #6dda8a;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@container contact (max-width: 460px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .contact-hero {
    flex-direction: column;
  }
}

.contact-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
  min-width: 0;
}

a.contact-card:hover {
  text-decoration: none;
  background: rgba(91, 159, 255, 0.06);
  border-color: rgba(91, 159, 255, 0.4);
}

.contact-card-ico {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  flex-shrink: 0;
  border: 1.5px solid rgba(91, 159, 255, 0.45);
  background: rgba(91, 159, 255, 0.1);
  color: #5b9fff;
}

.contact-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.contact-card-lbl {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--text-muted);
}

.contact-card-val {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-card-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.35;
}

.contact-card-go {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  align-self: center;
  opacity: 0.45;
}

a.contact-card:hover .contact-card-go {
  opacity: 0.9;
  color: #5b9fff;
}

.contact-copy-btn {
  align-self: center;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 9px;
  border-radius: 7px;
  border: 1px solid rgba(91, 159, 255, 0.4);
  background: rgba(91, 159, 255, 0.1);
  color: #5b9fff;
}

.contact-copy-btn:hover {
  background: rgba(91, 159, 255, 0.18);
}

.contact-copy-btn.copied {
  border-color: rgba(109, 218, 138, 0.45);
  background: rgba(109, 218, 138, 0.15);
  color: #6dda8a;
}

.contact-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 4px;
}

.btn-contact {
  background: #5b9fff;
  color: #061018;
}

.btn-contact:hover {
  background: #7eb6ff;
}

.window[data-app="contact"] .window-body {
  overflow: hidden;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: transform 0.2s var(--ease), background 0.15s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #061018;
  box-shadow: 0 4px 14px rgba(91, 159, 255, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 6px 18px rgba(91, 159, 255, 0.35);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.08);
}

/* Taskbar */
.taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 800;
  height: var(--taskbar-h);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  background: rgba(10, 14, 20, 0.94);
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.35);
}

.taskbar-start {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.taskbar-start img {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  object-fit: cover;
}

.taskbar-start:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
}

.taskbar-pinned,
.taskbar-windows {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.taskbar-windows {
  flex: 1;
  overflow: hidden;
  padding: 0 8px;
  min-width: 0;
}

.taskbar-focus-title {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.taskbar-focus-title.dim {
  opacity: 0.55;
}

.taskbar-sep {
  width: 1px;
  height: 22px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 4px;
}

.tb-btn {
  position: relative;
  height: 36px;
  min-width: 36px;
  padding: 0 8px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(140, 150, 165, 0.35);
  color: var(--text-dim);
  font-size: 0.9rem;
  font-family: var(--font-mono);
  font-weight: 600;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.tb-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.tb-btn[data-app="terminal"] {
  border-color: rgba(91, 159, 255, 0.65);
  color: #5b9fff;
  background: rgba(91, 159, 255, 0.08);
}

.tb-btn[data-app="files"] {
  border-color: rgba(240, 180, 41, 0.65);
  color: #f0b429;
  background: rgba(240, 180, 41, 0.08);
}

.tb-btn[data-app="projects"] {
  border-color: rgba(109, 218, 138, 0.65);
  color: #6dda8a;
  background: rgba(109, 218, 138, 0.08);
}

.tb-btn[data-app="about"] {
  border-color: rgba(199, 146, 234, 0.65);
  color: #c792ea;
  background: rgba(199, 146, 234, 0.08);
}

.tb-btn[data-app="contact"] {
  border-color: rgba(91, 159, 255, 0.65);
  color: #5b9fff;
  background: rgba(91, 159, 255, 0.08);
}

.tb-btn.active {
  filter: brightness(1.08);
}

.tb-btn.active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 3px;
  height: 2px;
  border-radius: 99px;
  background: currentColor;
  opacity: 0.7;
}

.tb-btn.focused {
  filter: brightness(1.15);
}

.tb-btn.focused::after {
  opacity: 1;
}

.tb-btn-label {
  font-size: 0.72rem;
  font-weight: 500;
  max-width: 110px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tb-btn.pinned .tb-btn-label {
  display: none;
}

.taskbar-tray {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
  padding: 0 6px 0 8px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.taskbar-avail {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.taskbar-clock {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.taskbar-link {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  border: 1px solid rgba(140, 150, 165, 0.28);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.85rem;
  transition: color 0.15s, border-color 0.15s;
}

.taskbar-link:hover {
  color: var(--accent);
  border-color: rgba(91, 159, 255, 0.45);
  text-decoration: none;
}

/* Welcome toast */
.toast {
  position: absolute;
  top: calc(var(--menubar-h) + 16px);
  right: 16px;
  z-index: 850;
  max-width: 300px;
  padding: 14px 16px;
  background: var(--bg-panel-solid);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.toast strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.toast p {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.45;
}

.toast kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--accent);
}

/* Scrollbars */
.window-body::-webkit-scrollbar,
.pane::-webkit-scrollbar {
  width: 8px;
}
.window-body::-webkit-scrollbar-thumb,
.pane::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
}

/* Phone site — separate from desktop OS (≤720px) */
.phone {
  display: none;
}

@media (max-width: 720px) {
  :root {
    --phone-top-h: 48px;
    --phone-tabs-h: 64px;
  }

  body.is-phone {
    overflow: hidden;
  }

  body.is-phone .wallpaper {
    display: none;
  }

  body.is-phone .menubar,
  body.is-phone .desktop-icons,
  body.is-phone .desktop-widgets,
  body.is-phone #windows,
  body.is-phone .taskbar {
    display: none !important;
  }

  body.is-phone .phone {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    z-index: 40;
    background:
      radial-gradient(ellipse 90% 50% at 50% -8%, rgba(91, 159, 255, 0.16), transparent 55%),
      var(--bg-deep);
    padding-top: env(safe-area-inset-top, 0px);
  }

  body.is-phone .toast {
    left: 12px;
    right: 12px;
    max-width: none;
    top: calc(env(safe-area-inset-top, 0px) + var(--phone-top-h) + 10px);
    z-index: 60;
  }

  .phone-top {
    flex-shrink: 0;
    height: var(--phone-top-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(10, 14, 20, 0.78);
    backdrop-filter: blur(12px);
  }

  .phone-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: -0.02em;
  }

  .phone-brand img {
    width: 22px;
    height: 22px;
    border-radius: 6px;
  }

  .phone-top-right {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--text-dim);
  }

  .phone-avail {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  #phone-clock {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--text);
  }

  .phone-pages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(var(--phone-tabs-h) + env(safe-area-inset-bottom, 0px));
    user-select: text;
  }

  .phone-page[hidden] {
    display: none !important;
  }

  .phone-page.is-active {
    animation: phonePageIn 0.3s var(--ease) both;
  }

  @keyframes phonePageIn {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  .phone-page-inner {
    padding: 22px 18px 28px;
    max-width: 560px;
    margin: 0 auto;
  }

  .phone-about-hero {
    text-align: center;
    margin-bottom: 22px;
  }

  .phone-avatar {
    width: 88px;
    height: 88px;
    border-radius: 22px;
    margin-bottom: 14px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  }

  .phone-about-hero h1 {
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
  }

  .phone-role {
    margin-top: 6px;
    margin-bottom: 14px;
    color: var(--text-dim);
    font-size: 0.95rem;
  }

  .phone-about-hero .badge-row {
    justify-content: center;
  }

  .phone-page-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
  }

  .phone-page-lead {
    margin-bottom: 18px;
  }

  .phone-cta {
    margin-top: 22px;
    flex-direction: column;
  }

  .phone-cta .btn {
    width: 100%;
    justify-content: center;
  }

  .phone-page .projects-grid {
    grid-template-columns: 1fr;
  }

  .phone-page .contact-app {
    padding: 22px 18px 28px;
  }

  .phone-page .contact-hero {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .phone-page .contact-footer {
    flex-direction: column;
    padding-bottom: 8px;
  }

  .phone-page .contact-footer .btn {
    width: 100%;
    justify-content: center;
  }

  .phone-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    align-items: stretch;
    height: calc(var(--phone-tabs-h) + env(safe-area-inset-bottom, 0px));
    padding: 6px 8px env(safe-area-inset-bottom, 0px);
    background: rgba(17, 24, 32, 0.94);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(16px);
  }

  .phone-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
  }

  .phone-tab-ico {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    line-height: 1;
    color: var(--text-dim);
  }

  .phone-tab.is-active {
    color: var(--accent);
    background: var(--accent-soft);
  }

  .phone-tab.is-active .phone-tab-ico {
    color: var(--accent);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── rm -rf * meltdown easter egg ── */
body.os-meltdown #desktop {
  animation: meltShake 0.12s linear infinite;
  filter: contrast(1.2) saturate(0.3);
}

body.os-meltdown .window {
  animation: meltJitter 0.08s steps(2) infinite;
}

#meltdown {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: #0078d7;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: meltIn 0.35s ease both;
  font-family: var(--font-ui);
}

#meltdown.melt-out {
  animation: meltFade 0.45s ease forwards;
}

.melt-cracks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 48%, rgba(0, 0, 0, 0.55) 49%, transparent 51%),
    linear-gradient(25deg, transparent 42%, rgba(0, 0, 0, 0.45) 43%, transparent 45%),
    linear-gradient(160deg, transparent 60%, rgba(0, 0, 0, 0.4) 61%, transparent 63%),
    linear-gradient(70deg, transparent 30%, rgba(255, 255, 255, 0.12) 31%, transparent 33%);
  background-size: 100% 100%;
  opacity: 0.85;
  mix-blend-mode: multiply;
  animation: meltCrack 0.6s steps(4) both;
}

.melt-glitch {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  animation: meltScan 1.2s linear infinite;
}

.melt-bsod {
  position: relative;
  z-index: 2;
  max-width: 640px;
  width: 100%;
}

.melt-face {
  font-size: 5rem;
  line-height: 1;
  margin-bottom: 18px;
  font-weight: 300;
}

.melt-bsod h1 {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 500;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.melt-sub {
  font-size: 1rem;
  line-height: 1.5;
  opacity: 0.92;
  margin-bottom: 22px;
}

.melt-sub code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 7px;
  border-radius: 4px;
}

.melt-progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 10px;
}

.melt-progress-fill {
  height: 100%;
  width: 0%;
  background: #fff;
  transition: width 0.15s linear;
}

.melt-pct {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  opacity: 0.85;
  margin-bottom: 16px;
}

.melt-codes {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.45;
  opacity: 0.75;
  max-height: 140px;
  overflow: hidden;
  margin-bottom: 22px;
  white-space: pre-wrap;
}

.melt-reboot {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 4px;
  background: #fff;
  color: #0078d7;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.melt-reboot:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.melt-hint {
  margin-top: 12px;
  font-size: 0.75rem;
  opacity: 0.7;
}

@keyframes meltIn {
  from {
    opacity: 0;
    transform: scale(1.04);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes meltFade {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes meltShake {
  0%,
  100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-3px, 1px);
  }
  50% {
    transform: translate(3px, -2px);
  }
  75% {
    transform: translate(-2px, 2px);
  }
}

@keyframes meltJitter {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(1px, -1px) rotate(0.2deg);
  }
  100% {
    transform: translate(-1px, 1px) rotate(-0.2deg);
  }
}

@keyframes meltCrack {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes meltScan {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(4px);
  }
}

@media (max-width: 720px) {
  .melt-face {
    font-size: 3.5rem;
  }

  .melt-codes {
    max-height: 100px;
    font-size: 0.6rem;
  }
}
