:root {
  color-scheme: dark;
  --bg: #071015;
  --bg-elevated: rgba(15, 24, 31, 0.82);
  --panel: rgba(18, 29, 38, 0.76);
  --panel-strong: rgba(21, 34, 44, 0.94);
  --text: #eef6f7;
  --muted: #9eb0b6;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #29d3a1;
  --accent-2: #5aa7ff;
  --accent-3: #f5c95b;
  --danger: #ff647c;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --radius: 8px;
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

body.light-mode {
  color-scheme: light;
  --bg: #eef3f5;
  --bg-elevated: rgba(255, 255, 255, 0.82);
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --text: #111b22;
  --muted: #58666d;
  --line: rgba(7, 16, 21, 0.13);
  --shadow: 0 24px 70px rgba(43, 59, 68, 0.22);
}

body.no-animations *,
body.no-animations *::before,
body.no-animations *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-duration: 0.001ms !important;
}

.boot-screen,
.os-shell::before,
.desktop::after {
  position: fixed;
  inset: 0;
}

.boot-screen {
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(41, 211, 161, 0.16), transparent 28%),
    radial-gradient(circle at 80% 30%, rgba(90, 167, 255, 0.17), transparent 28%),
    linear-gradient(135deg, #04090d, #0a171d 56%, #051111);
  transition: opacity 500ms ease, visibility 500ms ease;
}

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

.boot-card {
  width: min(520px, 100%);
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  background: rgba(9, 17, 23, 0.75);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.boot-logo {
  font-size: clamp(2.2rem, 7vw, 4.8rem);
  font-weight: 800;
  line-height: 0.95;
}

.boot-subtitle {
  margin-top: 10px;
  color: var(--muted);
}

.boot-progress {
  height: 8px;
  margin: 28px 0 20px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.boot-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 450ms ease;
}

.boot-log {
  min-height: 132px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  color: #bfe9dd;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.8;
}

.boot-log li::before {
  content: "> ";
  color: var(--accent);
}

.os-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(90, 167, 255, 0.16), transparent 34%),
    linear-gradient(315deg, rgba(41, 211, 161, 0.13), transparent 38%),
    var(--bg);
}

.os-shell::before {
  content: "";
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.88), transparent 95%);
  pointer-events: none;
}

.os-shell.wallpaper-aurora {
  background:
    radial-gradient(circle at 15% 22%, rgba(41, 211, 161, 0.22), transparent 32%),
    radial-gradient(circle at 82% 18%, rgba(90, 167, 255, 0.22), transparent 30%),
    radial-gradient(circle at 60% 80%, rgba(245, 201, 91, 0.12), transparent 35%),
    #071015;
}

.os-shell.wallpaper-carbon {
  background:
    linear-gradient(120deg, rgba(255,255,255,0.05), transparent 25%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 0 2px, transparent 2px 12px),
    #090f14;
}

.os-shell.wallpaper-sunrise {
  background:
    radial-gradient(circle at 70% 20%, rgba(245, 201, 91, 0.24), transparent 28%),
    radial-gradient(circle at 20% 82%, rgba(41, 211, 161, 0.2), transparent 32%),
    linear-gradient(145deg, #111827, #243642);
}

.top-bar,
.dock,
.start-menu,
.app-window,
.notification {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.top-bar {
  position: fixed;
  z-index: 50;
  top: 12px;
  right: 12px;
  left: 12px;
  display: grid;
  grid-template-columns: auto minmax(180px, 540px) auto;
  gap: 16px;
  align-items: center;
  min-height: 54px;
  padding: 8px;
  border-radius: var(--radius);
}

.system-button,
.status-pill,
.dock-button,
.button,
.window-control,
.icon-button,
.chip,
.browser-control {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, opacity 180ms ease;
}

.system-button {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 12px 0 6px;
  border-radius: var(--radius);
  font-weight: 700;
}

.system-mark,
.avatar,
.app-icon-symbol,
.dock-button span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #04110e;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.system-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.global-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
}

.global-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.global-search input::placeholder {
  color: var(--muted);
}

.status-cluster {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.status-pill {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.86rem;
}

.desktop {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 88px 18px 96px;
}

.desktop::after {
  content: "";
  z-index: -1;
  background: radial-gradient(circle at center, transparent 0, rgba(0,0,0,0.22) 86%);
  pointer-events: none;
}

.desktop-icons {
  display: grid;
  grid-template-columns: repeat(2, 92px);
  grid-auto-rows: 104px;
  gap: 12px;
  width: max-content;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 92px;
  min-height: 104px;
  padding: 10px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text);
  background: transparent;
  text-align: center;
}

.desktop-icon:hover,
.desktop-icon:focus-visible,
.dock-button:hover,
.system-button:hover,
.button:hover,
.icon-button:hover,
.browser-control:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.11);
}

.app-icon-symbol {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(0,0,0,0.26);
}

.desktop-icon span:last-child {
  max-width: 84px;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}

.window-layer {
  position: absolute;
  inset: 76px 14px 82px;
  pointer-events: none;
}

.app-window {
  position: absolute;
  display: flex;
  flex-direction: column;
  width: min(860px, calc(100vw - 56px));
  min-width: 320px;
  min-height: 320px;
  max-height: calc(100vh - 142px);
  overflow: hidden;
  border-radius: var(--radius);
  pointer-events: auto;
  transform-origin: center;
  animation: windowIn 220ms ease both;
}

.app-window.maximized {
  inset: 0 !important;
  width: auto !important;
  height: auto !important;
  max-height: none;
}

.app-window.minimizing {
  transform: translateY(24px) scale(0.96);
  opacity: 0;
}

.app-window.closing {
  transform: translateY(12px) scale(0.96);
  opacity: 0;
}

.window-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  user-select: none;
  touch-action: none;
}

.window-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-weight: 700;
}

.window-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  color: #03110d;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 0.75rem;
}

.window-controls {
  display: flex;
  gap: 7px;
}

.window-control {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  font-weight: 700;
  line-height: 1;
}

.window-control.close:hover {
  background: rgba(255, 100, 124, 0.28);
  border-color: rgba(255, 100, 124, 0.48);
}

.window-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 22px;
}

.dock {
  position: fixed;
  z-index: 60;
  bottom: 14px;
  left: 50%;
  display: flex;
  gap: 10px;
  padding: 9px;
  border-radius: var(--radius);
  transform: translateX(-50%);
}

.dock-button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: var(--radius);
}

.dock-button span {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.78rem;
}

.dock-button.running {
  border-color: rgba(41, 211, 161, 0.5);
}

.start-menu {
  position: fixed;
  z-index: 80;
  top: 76px;
  left: 12px;
  width: min(320px, calc(100vw - 24px));
  padding: 14px;
  border-radius: var(--radius);
}

.start-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.start-profile span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.85rem;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-weight: 800;
}

.start-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.start-app {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text);
  background: transparent;
  text-align: left;
}

.start-app:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.notifications {
  position: fixed;
  z-index: 90;
  right: 18px;
  bottom: 86px;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}

.notification {
  padding: 13px 14px;
  border-radius: var(--radius);
  animation: notificationIn 220ms ease both;
}

.notification strong {
  display: block;
  margin-bottom: 3px;
}

.notification span {
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
  align-items: stretch;
}

.profile-card,
.stat-card,
.project-card,
.skill-group,
.timeline-card,
.contact-panel,
.resume-section,
.browser-page,
.setting-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
}

.profile-card {
  padding: clamp(22px, 4vw, 36px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(41, 211, 161, 0.34);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(41, 211, 161, 0.08);
  font-size: 0.82rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

p {
  color: var(--muted);
  line-height: 1.7;
}

.role-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 22px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--text);
  font-size: 0.84rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.button-primary {
  border-color: transparent;
  color: #03110d;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.button-ghost {
  background: rgba(255, 255, 255, 0.06);
}

.profile-orbit {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background:
    radial-gradient(circle, rgba(41,211,161,0.22), transparent 30%),
    linear-gradient(135deg, rgba(255,255,255,0.05), transparent);
}

.profile-orbit::before,
.profile-orbit::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  animation: spin 18s linear infinite;
}

.profile-orbit::after {
  width: 300px;
  height: 300px;
  animation-duration: 28s;
  animation-direction: reverse;
}

.profile-core {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 138px;
  height: 138px;
  border-radius: 32px;
  color: #03110d;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 22px 55px rgba(41, 211, 161, 0.24);
  font-size: 2.5rem;
  font-weight: 800;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.stat-card {
  padding: 16px;
}

.stat-card strong {
  display: block;
  font-size: 1.35rem;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.85rem;
}

.project-toolbar,
.browser-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(41, 211, 161, 0.38);
  background: rgba(255,255,255,0.075);
}

.project-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
  background: rgba(0,0,0,0.18);
}

.project-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 14px;
}

.status-badge {
  align-self: flex-start;
  margin-bottom: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(41, 211, 161, 0.1);
  font-size: 0.76rem;
  font-weight: 700;
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 14px;
}

.tech-list span {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.75rem;
}

.project-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.project-actions .button {
  flex: 1;
  min-height: 36px;
  padding: 0 10px;
  font-size: 0.84rem;
}

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

.skill-group {
  padding: 16px;
}

.skill-item {
  margin-top: 16px;
}

.skill-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.88rem;
}

.progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 900ms ease;
}

.timeline {
  position: relative;
  display: grid;
  gap: 14px;
  padding-left: 20px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 6px;
  width: 2px;
  border-radius: 99px;
  background: linear-gradient(var(--accent), var(--accent-2), var(--accent-3));
}

.timeline-card {
  position: relative;
  padding: 16px;
}

.timeline-card::before {
  content: "";
  position: absolute;
  top: 18px;
  left: -20px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--bg);
  border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(41,211,161,0.15);
}

.timeline-card time {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
}

.terminal {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(0,0,0,0.46);
  font-family: var(--mono);
}

.terminal-output {
  flex: 1;
  min-height: 320px;
  overflow: auto;
  padding: 16px;
  color: #c9f6e7;
  line-height: 1.6;
  white-space: pre-wrap;
}

.terminal-input-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.terminal-input-line span {
  color: var(--accent);
}

.terminal-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-family: var(--mono);
}

.browser-toolbar {
  flex-wrap: wrap;
}

.browser-control,
.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius);
}

.browser-address {
  flex: 1;
  min-width: 220px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  color: var(--text);
  background: rgba(0,0,0,0.18);
}

.browser-page {
  min-height: 340px;
  padding: 22px;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 16px;
}

.contact-panel {
  padding: 18px;
}

.contact-form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  color: var(--text);
  background: rgba(0,0,0,0.18);
}

.field input,
.field select {
  height: 42px;
  padding: 0 12px;
}

.field textarea {
  min-height: 130px;
  resize: vertical;
  padding: 11px 12px;
}

.form-message {
  min-height: 22px;
  color: var(--accent);
  font-weight: 700;
}

.link-stack {
  display: grid;
  gap: 10px;
}

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

.resume-section {
  padding: 16px;
}

.resume-section ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

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

.setting-group {
  padding: 16px;
}

.segmented,
.wallpaper-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wallpaper-swatch {
  width: 72px;
  height: 48px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.wallpaper-swatch.active,
.chip.active {
  border-color: var(--accent);
}

.swatch-aurora {
  background: linear-gradient(135deg, #071015, #29d3a1, #5aa7ff);
}

.swatch-carbon {
  background: repeating-linear-gradient(45deg, #090f14 0 8px, #1b2a34 8px 16px);
}

.swatch-sunrise {
  background: linear-gradient(135deg, #111827, #f5c95b, #29d3a1);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 42px;
  color: var(--muted);
}

.toggle-row input {
  width: 42px;
  height: 22px;
  accent-color: var(--accent);
}

@keyframes windowIn {
  from {
    transform: translateY(16px) scale(0.97);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

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

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1120px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  body {
    overflow: auto;
  }

  .top-bar {
    top: 8px;
    right: 8px;
    left: 8px;
    grid-template-columns: 1fr auto;
  }

  .global-search {
    grid-column: 1 / -1;
    order: 3;
  }

  .status-cluster .status-pill:first-child,
  .status-cluster .status-pill:nth-child(2) {
    display: none;
  }

  .desktop {
    min-height: 100dvh;
    padding: 126px 12px 84px;
  }

  .desktop-icons {
    grid-template-columns: repeat(4, minmax(68px, 1fr));
    gap: 10px;
    width: 100%;
  }

  .desktop-icon {
    width: auto;
    min-height: 92px;
  }

  .app-icon-symbol {
    width: 46px;
    height: 46px;
  }

  .window-layer {
    position: fixed;
    inset: 0;
    z-index: 70;
  }

  .app-window,
  .app-window.maximized {
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-width: 0;
    max-height: none;
    border-width: 0;
    border-radius: 0;
  }

  .window-titlebar {
    min-height: 58px;
    padding-top: max(10px, env(safe-area-inset-top));
  }

  .window-control.maximize {
    display: none;
  }

  .window-content {
    padding: 16px;
  }

  .dock {
    right: 8px;
    bottom: 8px;
    left: 8px;
    justify-content: space-around;
    transform: none;
  }

  .dock-button {
    width: 54px;
    height: 46px;
  }

  .start-menu {
    top: 116px;
    left: 8px;
  }

  .hero-panel,
  .contact-layout,
  .settings-grid,
  .resume-grid,
  .skills-dashboard {
    grid-template-columns: 1fr;
  }

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

  .profile-orbit {
    min-height: 230px;
  }
}

@media (max-width: 520px) {
  .boot-card {
    padding: 22px;
  }

  .top-bar {
    gap: 8px;
  }

  .system-button {
    max-width: 150px;
  }

  .system-button span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .desktop-icons {
    grid-template-columns: repeat(3, minmax(76px, 1fr));
  }

  .desktop-icon span:last-child {
    font-size: 0.76rem;
  }

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

  .button-row,
  .project-actions,
  .project-toolbar {
    flex-direction: column;
  }

  .button,
  .project-actions .button {
    width: 100%;
  }

  h1 {
    font-size: 2.35rem;
  }
}

@media (max-width: 350px) {
  .desktop-icons {
    grid-template-columns: repeat(2, minmax(76px, 1fr));
  }

  .status-pill {
    padding: 0 8px;
  }
}

/* Expanded Frank OS interface */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 22% 18%, rgba(41, 211, 161, 0.18), transparent 30%),
    radial-gradient(circle at 78% 32%, rgba(90, 167, 255, 0.18), transparent 28%),
    linear-gradient(135deg, #03070a, #0b171d);
  transition: opacity 420ms ease, visibility 420ms ease;
}

.lock-screen.unlocked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.lock-content {
  text-align: center;
}

.lock-brand {
  margin-bottom: 24px;
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 800;
  line-height: 0.9;
}

.lock-content time {
  display: block;
  color: var(--muted);
  font-size: clamp(1.2rem, 4vw, 2.2rem);
  line-height: 1.35;
}

.matrix-mode {
  position: fixed;
  inset: 0;
  z-index: 1400;
  overflow: hidden;
  background: #020806;
}

.matrix-mode canvas {
  width: 100%;
  height: 100%;
}

.matrix-copy {
  position: absolute;
  left: 24px;
  bottom: 24px;
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid rgba(41, 211, 161, 0.35);
  border-radius: var(--radius);
  background: rgba(2, 8, 6, 0.75);
  color: #c9f6e7;
  font-family: var(--mono);
}

.os-icon {
  width: 28px;
  height: 28px;
}

.app-icon-symbol .os-icon,
.desktop-icon > .os-icon {
  width: 48px;
  height: 48px;
  padding: 10px;
  border-radius: 14px;
  color: #03110d;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 28px rgba(0,0,0,0.26);
}

.window-icon .os-icon,
.start-app .os-icon {
  width: 24px;
  height: 24px;
}

.desktop-icons {
  position: relative;
  display: block;
  width: min(248px, 100%);
  min-height: calc(100vh - 190px);
}

.desktop-icon {
  position: absolute;
  touch-action: none;
}

.desktop-icon.selected {
  border-color: rgba(41, 211, 161, 0.5);
  background: rgba(41, 211, 161, 0.1);
}

.resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
}

.resize-handle::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(255,255,255,0.35);
  border-bottom: 2px solid rgba(255,255,255,0.35);
}

.start-search {
  width: 100%;
  height: 38px;
  margin: 12px 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  color: var(--text);
  background: rgba(0,0,0,0.18);
}

.start-section-title {
  display: block;
  margin: 12px 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.start-actions {
  max-height: min(48vh, 420px);
  overflow: auto;
}

.start-power {
  display: grid;
  gap: 8px;
}

.start-app .os-icon {
  flex: 0 0 auto;
  color: var(--accent);
}

.profile-core {
  gap: 4px;
  color: #03110d;
}

.profile-core .os-icon {
  width: 44px;
  height: 44px;
}

.project-open-card {
  padding: 0;
  border: 1px solid var(--line);
  color: var(--text);
  text-align: left;
}

.project-open-card .project-body {
  color: var(--text);
}

.project-open-card .project-body > span:not(.status-badge):not(.tech-list) {
  color: var(--muted);
  line-height: 1.6;
}

.project-preview-bars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px 14px 0;
}

.project-preview-bars i {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  animation: pulseBar 1.8s ease-in-out infinite;
}

.project-preview-bars i:nth-child(2) {
  animation-delay: 180ms;
}

.project-preview-bars i:nth-child(3) {
  animation-delay: 360ms;
}

.project-detail-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.055);
}

.project-hero-image {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.skill-lab,
.cyber-grid,
.file-explorer,
.notes-app {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 16px;
}

.skill-map {
  display: grid;
  gap: 12px;
}

.skill-pill {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 10px;
  align-items: center;
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255,255,255,0.055);
  text-align: left;
}

.skill-pill meter {
  width: 100%;
}

.skill-detail,
.cyber-panel,
.file-content,
.notes-app aside,
.note-editor,
.empty-state {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.055);
}

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

.stat-stack {
  display: grid;
  gap: 10px;
}

.stat-stack div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0,0,0,0.16);
}

.stat-stack span,
.check-list span {
  color: var(--muted);
}

.stat-stack strong,
.check-list .ok {
  color: var(--accent);
}

.mini-terminal,
.cipher-output {
  min-height: 170px;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0,0,0,0.42);
  color: #c9f6e7;
  font-family: var(--mono);
  white-space: pre-wrap;
}

.cipher-input {
  width: 100%;
  min-height: 112px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  color: var(--text);
  background: rgba(0,0,0,0.18);
}

.check-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.game-center {
  display: grid;
  gap: 14px;
}

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

.game-stage {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.055);
}

.game-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.game-canvas {
  display: block;
  width: min(360px, 100%);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #071015;
}

.memory-board,
.ttt-board {
  display: grid;
  gap: 8px;
  max-width: 420px;
  margin: 14px 0;
}

.memory-board button,
.ttt-board button {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255,255,255,0.08);
  font-size: 1.5rem;
  font-weight: 800;
}

.memory-board button.matched {
  border-color: rgba(41, 211, 161, 0.52);
  background: rgba(41, 211, 161, 0.16);
}

.ttt-board {
  grid-template-columns: repeat(3, 1fr);
}

.ttt-board .win {
  background: rgba(41, 211, 161, 0.26);
}

.reaction-pad {
  display: grid;
  place-items: center;
  width: min(460px, 100%);
  min-height: 230px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255,255,255,0.08);
  font-size: 1.4rem;
  font-weight: 800;
}

.reaction-pad.waiting {
  background: rgba(245, 201, 91, 0.16);
}

.reaction-pad.ready {
  background: rgba(41, 211, 161, 0.22);
}

.server-health {
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}

.server-health span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.defender-threat {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid rgba(255,100,124,0.32);
  border-radius: var(--radius);
  background: rgba(255,100,124,0.09);
  font-family: var(--mono);
  font-weight: 800;
}

.file-explorer {
  grid-template-columns: 260px 1fr;
}

.file-tree {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.055);
}

.file-tree summary {
  margin-top: 10px;
  color: var(--accent);
  cursor: pointer;
  font-weight: 800;
}

.file-tree button,
.note-list button {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text);
  background: transparent;
  text-align: left;
}

.file-tree button:hover,
.note-list button:hover {
  border-color: var(--line);
  background: rgba(255,255,255,0.08);
}

.file-content pre {
  white-space: pre-wrap;
  color: var(--muted);
  line-height: 1.7;
}

.notes-app {
  grid-template-columns: 260px 1fr;
}

.note-list {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.note-editor {
  display: grid;
  gap: 12px;
}

.note-editor textarea {
  min-height: 300px;
}

.calculator {
  display: grid;
  gap: 14px;
}

.calculator output {
  display: block;
  min-height: 76px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(0,0,0,0.22);
  font-family: var(--mono);
  font-size: 2rem;
  text-align: right;
  text-overflow: ellipsis;
}

.calc-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.calc-keys button {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255,255,255,0.08);
  font-weight: 800;
}

.calc-keys .equals {
  grid-column: span 2;
  color: #03110d;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

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

.monitor-card,
.achievement {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.055);
}

.monitor-bar {
  height: 12px;
  margin: 12px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}

.monitor-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.achievement.unlocked {
  border-color: rgba(41,211,161,0.4);
  background: rgba(41,211,161,0.1);
}

.empty-state {
  display: grid;
  place-items: start;
  gap: 10px;
}

.empty-state code {
  color: var(--accent);
}

body.cyber-theme {
  --bg: #020806;
  --bg-elevated: rgba(2, 14, 10, 0.86);
  --panel: rgba(3, 18, 13, 0.82);
  --panel-strong: rgba(4, 25, 18, 0.96);
  --accent: #39ff9c;
  --accent-2: #00d7ff;
  --muted: #9de3c4;
}

body.konami .os-shell {
  filter: hue-rotate(95deg) saturate(1.35);
}

.os-shell.wallpaper-cybergrid {
  background:
    linear-gradient(rgba(41,211,161,0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(41,211,161,0.12) 1px, transparent 1px),
    #04100d;
  background-size: 36px 36px;
}

.os-shell.wallpaper-rain {
  background:
    repeating-linear-gradient(90deg, rgba(41,211,161,0.1) 0 1px, transparent 1px 22px),
    linear-gradient(180deg, #020806, #071015);
}

.os-shell.wallpaper-minimal {
  background: #020304;
}

.os-shell.wallpaper-workspace {
  background:
    linear-gradient(135deg, rgba(245,201,91,0.12), transparent 35%),
    linear-gradient(315deg, rgba(90,167,255,0.16), transparent 38%),
    #111827;
}

.os-shell.wallpaper-blue {
  background:
    radial-gradient(circle at 72% 20%, rgba(90,167,255,0.28), transparent 34%),
    linear-gradient(135deg, #061225, #0b2744);
}

.os-shell.wallpaper-terminal {
  background:
    repeating-linear-gradient(0deg, rgba(41,211,161,0.06) 0 2px, transparent 2px 22px),
    #030806;
}

.swatch-cybergrid {
  background: linear-gradient(135deg, #04100d, #39ff9c);
}

.swatch-rain {
  background: repeating-linear-gradient(90deg, #020806 0 8px, #29d3a1 8px 10px);
}

.swatch-minimal {
  background: #020304;
}

.swatch-workspace {
  background: linear-gradient(135deg, #111827, #f5c95b, #5aa7ff);
}

.swatch-blue {
  background: linear-gradient(135deg, #061225, #5aa7ff);
}

.swatch-terminal {
  background: repeating-linear-gradient(0deg, #030806 0 8px, #29d3a1 8px 10px);
}

@keyframes pulseBar {
  0%, 100% { opacity: 0.38; transform: scaleX(0.76); }
  50% { opacity: 1; transform: scaleX(1); }
}

@media (max-width: 820px) {
  .desktop-icons {
    display: grid;
    grid-template-columns: repeat(4, minmax(68px, 1fr));
    min-height: 0;
    width: 100%;
  }

  .desktop-icon {
    position: static;
  }

  .resize-handle {
    display: none;
  }

  .skill-lab,
  .cyber-grid,
  .file-explorer,
  .notes-app,
  .monitor-grid,
  .achievement-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .desktop-icons {
    grid-template-columns: repeat(3, minmax(76px, 1fr));
  }

  .game-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .memory-board button,
  .ttt-board button {
    min-height: 54px;
  }
}
