/* ============================================================
   Design tokens
   ============================================================ */
:root {
  /* Ubuntu palette */
  --ub-orange:    #e95420;
  --ub-purple:    #2c001e;
  --ub-panel:     rgba(14, 14, 20, 0.96);
  --ub-panel-b:   #0e0e14;

  /* Android palette */
  --droid-bg:     #0f172a;
  --droid-nav:    rgba(10, 15, 30, 0.95);
  --droid-card:   rgba(255,255,255,0.06);
  --droid-accent: #38bdf8;

  /* Window chrome */
  --win-bg:       #0d1117;
  --win-title:    #161b27;
  --win-border:   rgba(255,255,255,0.07);
  --win-shadow:   0 12px 40px rgba(0,0,0,0.55);

  /* Common */
  --accent:       #6ef2b6;
  --text-pri:     #e8eaf0;
  --text-sec:     #7d8ba8;
  --radius-win:   10px;
}

/* ============================================================
   Reset / base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

html { overscroll-behavior: none; }

/* sr-only (accessible hidden) */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Particle canvas — lives inside #screen
   ============================================================ */
#particle-canvas {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  z-index: 2;           /* above ::before gradient (z-1) so particles are visible */
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}
/* Make the particle lib's internal background div transparent so screen gradient shows through */
#particle-canvas > div { background: transparent !important; }

/* ============================================================
   Outer device frame
   ============================================================ */
body {
  background: #080c14;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Restore interactive mouse events only on the canvas inside #screen */
#particle-canvas canvas { pointer-events: auto; }

main {
  position: relative;
  z-index: 1;             /* sits above particle-canvas */
  width: 96vw;
  height: 96vh;
  padding: 1.5rem 0.6rem 0.6rem;
  background: rgba(18, 22, 34, 0.88);
  border: 3px solid #3a3a3a;
  border-radius: 10px;
  box-sizing: border-box;
  display: flex;
  box-shadow: 0 0 80px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(2px);
}

/* camera notch */
main::before {
  content: '';
  position: absolute;
  top: 0.5rem; left: 50%;
  transform: translateX(-50%);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #333;
  box-shadow: 0 0 0 2px #555;
}

/* ============================================================
   Inner screen  (Ubuntu wallpaper on desktop)
   ============================================================ */
#screen {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  color: var(--text-pri);
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* Particle canvas provides the base colour; gradient goes on ::before */
  background: #080c14;
  /* KEY: makes #screen the containing block for position:fixed children
     (maximized windows will be fixed relative to this, not the viewport) */
  transform: translateZ(0);
}

/* Ubuntu gradient overlay — sits above particle canvas, below content */
#screen::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(ellipse 80% 60% at 15% 40%, rgba(93,30,100,0.45) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 85% 20%, rgba(233,84,32,0.22) 0%, transparent 45%),
    radial-gradient(ellipse 70% 70% at 50% 100%, rgba(20,50,120,0.28) 0%, transparent 60%);
}

/* Favicon watermark — large, faded, centred on the screen */
.screen-watermark {
  position: absolute;
  inset: 0;
  z-index: 3;          /* above gradient (z-1) & particles (z-2), below content (z-4) */
  pointer-events: none;
  background: url('/favicon.svg') center / 65% auto no-repeat;
  opacity: 0.04;
  filter: grayscale(1) brightness(3);
}

.screen-content {
  flex: 1 1 auto;
  overflow: hidden;     /* desktop: windows scroll internally via lw-body */
  position: relative;
  z-index: 4;           /* above particles (z-2) and watermark (z-3) */
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.6rem 0.75rem 4rem;
  gap: 0.6rem;
  /* allow children to fill available height */
  min-height: 0;
}
/* Full-height wrapper used by multi-app layouts */
.screen-content > .projects-layout,
.screen-content > .about-layout {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

/* Blur content when activities overlay open (keep desktop effect) */
body.activities-open .screen-content,
body.activities-open .dock {
  filter: blur(6px) brightness(0.5);
  pointer-events: none;
}

/* (menu-overlay is toggled by the CSS checkbox, no JS class needed) */

/* ============================================================
   Header  (Ubuntu GNOME top panel)
   ============================================================ */
.screen-header {
  position: relative;
  z-index: 4;             /* above everything in screen */
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ub-panel);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  border-top-left-radius: 7px;
  border-top-right-radius: 7px;
  position: sticky;
  top: 0; left: 0; right: 0;
  z-index: 99999;
  height: 32px;
  padding: 0 6px;
  gap: 0;
  font-size: 0.8rem;
  color: #b8c3d8;
  user-select: none;
  backdrop-filter: blur(10px);
}

/* Left */
.header-left {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 2px;
  overflow: hidden;
}

/* ── Ubuntu Activities button ── */
.activities-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: #b0bcd4;
  border: none;
  border-radius: 5px;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 0.78rem;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.activities-btn:hover,
.activities-btn[aria-expanded="true"],
.activities-btn.is-open {
  background: rgba(233,84,32,0.18);
  color: var(--ub-orange);
}

/* Animated Ubuntu logo mark */
.ub-logo {
  position: relative;
  width: 16px; height: 16px;
  flex-shrink: 0;
}
.ub-ring {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 2px solid var(--ub-orange);
  animation: ub-pulse 2.5s ease-in-out infinite;
}
.ub-dot {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ub-orange);
}
.ub-dot-top { top: 0;   left: 50%; transform: translateX(-50%); }
.ub-dot-bl  { bottom: 0; left: 0; }
.ub-dot-br  { bottom: 0; right: 0; }
.activities-btn:hover .ub-ring,
.activities-btn.is-open .ub-ring {
  animation: ub-spin 1s linear infinite;
  border-style: dashed;
}

.activities-label { font-weight: 600; }

/* Mobile hamburger (hidden on desktop, shown on mobile) */
.mobile-menu-label {
  display: none;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  cursor: pointer;
  border-radius: 5px;
  color: #b0bcd4;
  transition: background 0.15s;
  flex-shrink: 0;
}
.mobile-menu-label svg { width: 18px; height: 12px; }
.mobile-menu-label:hover { background: rgba(255,255,255,0.08); }

/* Site nav (desktop: visible links in top bar) */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  color: #8a96b0;
  text-decoration: none;
  font-size: 0.78rem;
  padding: 3px 8px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-link:hover   { background: rgba(255,255,255,0.07); color: #c8d0e8; }
.nav-link--active { color: var(--accent); }

/* Center clock */
.header-status {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #c8cfe0;
  font-size: 0.8rem;
  flex: 0 0 auto;
  white-space: nowrap;
}
.header-sep { color: #4a5580; }

/* Right tray */
.header-right {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: flex-end;
}
.tray-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 5px;
  border-radius: 4px;
  cursor: default;
  transition: background 0.15s;
}
.tray-item svg { width: 13px; height: 13px; }
.tray-item:hover { background: rgba(255,255,255,0.08); }
.tray-battery { font-size: 0.72rem; }
.battery-pct  { font-size: 0.72rem; color: var(--accent); }

/* ============================================================
   Activities overlay  (Ubuntu app switcher)
   ============================================================ */
.activities-overlay {
  position: absolute;
  inset: 32px 0 0 0;
  z-index: 99990;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s;
}
.activities-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.activities-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
}
.activities-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 36px 24px;
  width: 100%;
  max-width: 640px;
  transform: translateY(-16px);
  transition: transform 0.18s;
}
.activities-overlay.is-open .activities-panel { transform: translateY(0); }

.activities-search {
  width: 340px;
  max-width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 24px;
  color: #e8eaf0;
  font-size: 0.95rem;
  font-family: inherit;
  padding: 9px 18px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.activities-search:focus {
  border-color: var(--ub-orange);
  background: rgba(255,255,255,0.11);
}
.activities-search::placeholder { color: #5a6580; }

/* Activities app grid */
.activities-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: center;
}

.act-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #c8d0e8;
  opacity: 0;
  transform: scale(0.5) translateY(12px);
  transition: color 0.15s;
}
.act-app--enter {
  animation: icon-pop 0.35s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
.act-app:hover .act-icon { animation: icon-bounce 0.5s ease; }
.act-app:hover { color: #fff; }

.act-app--active .act-icon {
  outline: 3px solid rgba(255,255,255,0.9);
  outline-offset: 3px;
}

.act-icon {
  width: 72px; height: 72px;
  border-radius: 20px;
  background: linear-gradient(145deg, var(--g1), var(--g2));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.45),
              0 1px 0 rgba(255,255,255,0.15) inset;
}
.act-icon svg { width: 34px; height: 34px; position: relative; z-index: 1; }

/* Shine sweep on hover */
.act-icon-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.25) 50%, transparent 70%);
  transform: translateX(-140%) rotate(25deg);
}
.act-app:hover .act-icon-shine {
  animation: shine-sweep 0.55s ease forwards;
}

.act-app span {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 6px rgba(0,0,0,0.9);
}

/* ============================================================
   App icon  (shared by Activities overlay + side drawer)
   ============================================================ */

/* ── Keyframes ── */
@keyframes icon-pop {
  0%   { transform: scale(0.5) translateY(12px); opacity: 0; }
  70%  { transform: scale(1.08) translateY(-3px); }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes icon-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  40%       { transform: translateY(-8px) scale(1.12); }
  65%       { transform: translateY(-3px) scale(1.05); }
}
@keyframes dock-bounce {
  0%, 100% { transform: translateY(0)  scale(1);    }
  40%       { transform: translateY(-10px) scale(1.18); }
  65%       { transform: translateY(-4px)  scale(1.06); }
}
@keyframes ub-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes ub-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(233,84,32,0.6); }
  50%       { box-shadow: 0 0 0 5px rgba(233,84,32,0); }
}
@keyframes shine-sweep {
  0%   { transform: translateX(-140%) rotate(25deg); }
  100% { transform: translateX(140%)  rotate(25deg); }
}

/* ============================================================
   Mobile side drawer
   ============================================================ */
.menu-toggle { display: none; }

.menu-overlay {
  position: absolute;   /* contained by #screen (which has transform) */
  inset: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 9000;
}
.menu-toggle:checked ~ .menu-overlay { opacity: 1; pointer-events: auto; }

.side-menu {
  position: absolute;
  top: 32px; left: 0; bottom: 0;
  width: 230px;
  background: rgba(14,18,34,0.97);
  backdrop-filter: blur(18px);
  border-right: 1px solid rgba(255,255,255,0.07);
  padding: 20px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: translateX(-100%);
  transition: transform 0.24s cubic-bezier(0.4,0,0.2,1);
  z-index: 9001;
}
.menu-toggle:checked ~ .side-menu { transform: translateX(0); }

.side-menu-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 0 4px;
  margin: 0;
}

/* 2×2 icon-only grid in drawer */
.side-app-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 4px 0;
}
.side-app {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,0.04);
  transition: background 0.15s, transform 0.15s;
  aspect-ratio: 1;
}
.side-app:active { transform: scale(0.9); }
.side-app svg {
  width: 36px; height: 36px;
  padding: 8px;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--g1), var(--g2));
  box-shadow: 0 3px 12px rgba(0,0,0,0.45);
  flex-shrink: 0;
}
.side-app:hover { background: rgba(255,255,255,0.09); }

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 10px;
}
.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #555e7a;
  text-decoration: none;
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.mobile-nav-link:hover { background: rgba(255,255,255,0.06); color: #c8d0e8; }

/* ============================================================
   App window chrome  (GNOME-style)
   ============================================================ */
.lw-placeholder { background: transparent; }

.lw-container {
  background: var(--win-bg);
  color: var(--text-pri);
  border: 1px solid var(--win-border);
  border-radius: var(--radius-win);
  box-shadow: var(--win-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Normal document flow — no absolute positioning */
  position: relative;
  /* Dragging shifts via transform; keep layout stable */
  will-change: transform;
}
.lw-container.lw-dragging { box-shadow: 0 24px 60px rgba(0,0,0,0.7); cursor: grabbing; }

.lw-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: var(--win-title);
  border-radius: var(--radius-win) var(--radius-win) 0 0;
  flex-shrink: 0;
  cursor: grab;
  user-select: none;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.lw-titlebar:active { cursor: grabbing; }
.lw-container.lw-maximized .lw-titlebar { cursor: default; }

.lw-title {
  color: #c0cbdf;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  flex: 1;
}

.lw-wm-buttons {
  display: flex;
  gap: 5px;
  align-items: center;
  position: relative;
}

.lw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  font-size: 0.7rem;
  cursor: pointer;
  color: transparent;
  border: none;
  transition: background 0.15s, color 0.15s;
  user-select: none;
}
/* macOS-style traffic lights */
.lw-min   { background: #f4c430; }
.lw-max   { background: #28c840; }
.lw-close { background: #ff5f57; }
.lw-btn:hover { color: rgba(0,0,0,0.7); }
.lw-close:hover { background: #ff3b30; }
.lw-min:hover   { background: #e0a800; }
.lw-max:hover   { background: #1ba832; }

/* Window states */
.lw-container.lw-minimized .lw-body,
.lw-container.lw-minimized .lw-menubar { display: none; }
.lw-container.lw-closed { display: none !important; }

/* Maximized: fixed relative to #screen (which has transform: translateZ(0))
   top: 32px = just below the 32px header
   bottom: 62px = above the dock (52px height + 10px gap)            */
.lw-container.lw-maximized {
  position: fixed !important;
  top: 32px !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 62px !important;
  width: 100% !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  z-index: 5000 !important;
  transform: none !important;
}

/* Menu bar */
.lw-menubar {
  display: flex;
  gap: 2px;
  padding: 2px 8px;
  background: #11151f;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  flex-shrink: 0;
}
.lw-menu-item {
  color: #7d8ba8;
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 3px;
  cursor: default;
  user-select: none;
  transition: background 0.15s, color 0.15s;
}
.lw-menu-item:hover { background: rgba(255,255,255,0.07); color: #c8d0e8; }

/* Body */
.lw-body {
  padding: 10px 16px 16px;
  line-height: 1.6;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  scrollbar-color: #2c3345 #0d1117;
  scrollbar-width: thin;
  word-break: break-word;
  overflow-wrap: break-word;
}
.lw-body::-webkit-scrollbar       { width: 5px; }
.lw-body::-webkit-scrollbar-track { background: #0d1117; }
.lw-body::-webkit-scrollbar-thumb { background: #2c3345; border-radius: 6px; }

.lw-mono  { font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace; }
.lw-nopad { padding: 0; }

/* Resize handles */
.lw-resize { position: absolute; z-index: 100; }
.lw-resize-n  { top: 0;    left: 6px;  right: 6px;  height: 5px; cursor: n-resize; }
.lw-resize-s  { bottom: 0; left: 6px;  right: 6px;  height: 5px; cursor: s-resize; }
.lw-resize-e  { right: 0;  top: 6px;   bottom: 6px; width: 5px;  cursor: e-resize; }
.lw-resize-w  { left: 0;   top: 6px;   bottom: 6px; width: 5px;  cursor: w-resize; }
.lw-resize-ne { top: 0;    right: 0;   width: 10px; height: 10px; cursor: ne-resize; }
.lw-resize-nw { top: 0;    left: 0;    width: 10px; height: 10px; cursor: nw-resize; }
.lw-resize-se { bottom: 0; right: 0;   width: 10px; height: 10px; cursor: se-resize; }
.lw-resize-sw { bottom: 0; left: 0;    width: 10px; height: 10px; cursor: sw-resize; }
.lw-container.lw-maximized .lw-resize { display: none; }
.lw-container.lw-dragging  { box-shadow: 0 24px 60px rgba(0,0,0,0.75); cursor: grabbing; z-index: 5000; }
.lw-container.lw-resizing  { cursor: se-resize; z-index: 5000; }

/* ============================================================
   Window manager container (no longer uses react-grid-layout)
   ============================================================ */
.window-manager-container {
  width: 100%;
  display: contents; /* transparent wrapper */
}

/* ============================================================
   Terminal  (home page live log)
   ============================================================ */
.live-log {
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  white-space: pre-wrap;
  margin: 0; padding: 0 6px 4px;
  max-height: 360px;
  overflow-y: auto;
  scrollbar-color: #2c3345 #0d1117;
  scrollbar-width: thin;
}
.log-line             { margin: 0; padding: 0; }
.log-line + .log-line { margin-top: 3px; }
.prompt   { color: #ff7ac6; }
.cmd-text { color: #7ce7ff; }
.info     { color: #8de1ff; }
.step     { color: #ffd166; }
.ok       { color: var(--accent); }
.warn     { color: #f4c95d; }
.error    { color: #ff6b81; }

.ascii-art {
  color: var(--accent);
  font-size: clamp(0.22rem, 1.4vw, 0.85rem);
  line-height: 1.18;
  white-space: pre;
  max-width: 100%;
  overflow: hidden;
  display: block;
  margin-bottom: 6px;
}

/* ============================================================
   About page
   ============================================================ */
.about-layout {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 0.6rem;
  width: 100%;
  max-width: 1100px;
  height: 100%;
  min-height: 0;
}
.about-top {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0.6rem;
  width: 100%;
  min-height: 0;
}
.about-top > * { min-height: 0; }
.about-left  { min-width: 0; }
.about-right { width: 100%; }
.about-contact { width: 100%; }

.about-copy {
  color: #d8dde8;
  font-size: 1rem;
  line-height: 1.75;
}
.about-copy h1 {
  font-size: 1.5rem;
  margin: 0 0 0.75rem;
  color: #e8eaf0;
}
.about-copy p { margin: 0; }

.about-photo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.about-photo {
  width: 100%;
  height: auto;
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  display: block;
}
.about-name {
  color: #9aa5c0;
  font-size: 0.9rem;
  text-align: center;
  margin: 0;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Contact tabs */
.contact-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 0.5rem;
}
.contact-tab {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: var(--text-sec);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 5px 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.contact-tab:hover  { background: rgba(255,255,255,0.07); color: #c8d0e8; }
.contact-tab.active { background: rgba(110,242,182,0.12); color: var(--accent); border-color: var(--accent); }

.contact-panel        { display: block; }
.contact-panel--hidden { display: none !important; }

/* GitHub card */
.gh-card {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}
.gh-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.gh-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.gh-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #c8cfe0;
}
.gh-username {
  margin: 0;
  font-size: 0.82rem;
  color: var(--accent);
  font-family: 'SF Mono', monospace;
}
.gh-contrib {
  margin-top: 0.5rem;
  max-width: 340px;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: #fff;
  padding: 4px 6px;
}
.gh-profile-link {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  font-family: 'SF Mono', monospace;
  color: var(--text-sec);
  text-decoration: none;
  transition: color 0.15s;
}
.gh-profile-link:hover { color: var(--accent); }

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 520px;
}
.cf-label {
  font-size: 0.82rem;
  color: var(--text-sec);
  margin-bottom: -0.4rem;
}
.cf-input {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: #c8cfe0;
  font-family: inherit;
  font-size: 0.88rem;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.15s;
}
.cf-input:focus { border-color: var(--accent); }
.cf-textarea    { resize: vertical; min-height: 100px; }
.cf-submit {
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 100px;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.88rem;
  padding: 7px 22px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.cf-submit:hover { background: var(--accent); color: #0d1117; }

/* Maximized about adjustments */
.lw-container.lw-maximized .lw-body {
  display: flex;
  flex-direction: column;
  padding: 12px 24px 16px;
}
.lw-container.lw-maximized .contact-panel {
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; padding-top: 1.5rem;
}
.lw-container.lw-maximized .gh-card {
  flex-direction: column; align-items: center; text-align: center; gap: 0.75rem;
  width: 100%; max-width: 580px;
}
.lw-container.lw-maximized .gh-avatar { width: 96px; height: 96px; }
.lw-container.lw-maximized .gh-info   { width: 100%; align-items: center; }
.lw-container.lw-maximized .gh-contrib { max-width: 100%; width: 100%; }
.lw-container.lw-maximized .contact-form { width: 100%; max-width: 520px; }
.lw-container.lw-maximized .cf-textarea  { min-height: 160px; }
.lw-container.lw-maximized .about-photo-wrap {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.75rem; min-height: 0;
}
.lw-container.lw-maximized .about-photo { max-height: 100%; max-width: 100%; object-fit: contain; }
.lw-container.lw-maximized .about-copy  { max-width: 72ch; margin: auto; font-size: 1.05rem; }

/* ============================================================
   Projects & Resume pages
   ============================================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  padding: 4px 0;
}
.project-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 1rem;
  transition: border-color 0.2s, transform 0.15s;
}
.project-card:hover { border-color: rgba(110,242,182,0.35); transform: translateY(-2px); }
.project-card h3    { margin: 0 0 0.5rem; font-size: 0.98rem; color: #e8eaf0; }
.project-card p     { margin: 0; font-size: 0.85rem; color: var(--text-sec); line-height: 1.5; }
.project-tag {
  display: inline-block;
  margin: 0.5rem 0.25rem 0 0;
  padding: 2px 8px;
  background: rgba(110,242,182,0.1);
  border: 1px solid rgba(110,242,182,0.25);
  border-radius: 12px;
  font-size: 0.72rem;
  color: var(--accent);
  font-family: 'SF Mono', monospace;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 4px 0;
}
.skill-chip {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.8rem;
  color: #c8d0e8;
  transition: background 0.15s, border-color 0.15s;
}
.skill-chip:hover { background: rgba(110,242,182,0.1); border-color: rgba(110,242,182,0.3); }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  position: relative;
  padding: 0 0 1.25rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text-sec);
  border-left: 1px solid rgba(255,255,255,0.1);
}
.timeline li::before {
  content: '';
  position: absolute;
  left: -4px; top: 6px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline li strong { color: #e8eaf0; font-size: 0.95rem; display: block; margin-bottom: 3px; }

/* Resume */
.resume-section { margin-bottom: 1.5rem; }
.resume-section h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(110,242,182,0.2);
  font-family: 'SF Mono', monospace;
}
.resume-item { margin-bottom: 1rem; }
.resume-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.resume-item-head strong { font-size: 0.92rem; color: #e8eaf0; }
.resume-item-head span   { font-size: 0.78rem; color: var(--text-sec); white-space: nowrap; }
.resume-item p  { margin: 0.25rem 0 0; font-size: 0.85rem; color: var(--text-sec); }

/* ============================================================
   Cat page
   ============================================================ */
.cat-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem;
  text-align: center;
}
#continueBtn, #noBtn {
  background: transparent;
  border-radius: 6px;
  padding: 10px 36px;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: background 0.2s, color 0.2s, transform 0.1s;
}
#continueBtn {
  color: var(--accent);
  border: 2px solid var(--accent);
}
#continueBtn:hover { background: var(--accent); color: #0d1117; }
#noBtn {
  color: #ff5f57;
  border: 2px solid #ff5f57;
}
#noBtn:hover { background: #ff5f57; color: #fff; }

/* ============================================================
   Ubuntu dock  (desktop taskbar)
   ============================================================ */
.dock {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(14,14,22,0.88);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  height: 52px;
  padding: 0 12px;
  /* floating at bottom center */
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  z-index: 99998;
  box-shadow: 0 4px 30px rgba(0,0,0,0.6);
  backdrop-filter: blur(14px);
}

.dock-pinned {
  display: flex;
  align-items: center;
  gap: 2px;
}

.dock-pin {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  text-decoration: none;
  flex-shrink: 0;
}
.dock-pin:hover .dock-icon-wrap { animation: dock-bounce 0.45s ease; }
.dock-pin--active .dock-icon-wrap {
  outline: 2.5px solid rgba(255,255,255,0.85);
  outline-offset: 2px;
}
.dock-pin--active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #fff;
}

/* Colored icon bubble shared by dock + activities */
.dock-icon-wrap {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--g1), var(--g2));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.45),
              0 1px 0 rgba(255,255,255,0.15) inset;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.dock-pin:hover .dock-icon-wrap {
  box-shadow: 0 6px 18px rgba(0,0,0,0.5),
              0 0 0 1px rgba(255,255,255,0.18) inset;
}
.dock-icon-wrap svg { width: 18px; height: 18px; position: relative; z-index: 1; }

.dock-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20,20,30,0.9);
  color: #e8eaf0;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
}
.dock-pin:hover .dock-tooltip { opacity: 1; }

.dock-sep {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,0.12);
  margin: 0 6px;
  flex-shrink: 0;
}

/* Open windows in dock */
.dock-windows {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 4px;
}
.dock-windows::-webkit-scrollbar { display: none; }
.dock-placeholder {
  font-size: 0.72rem;
  color: #3a4460;
  font-style: italic;
  padding: 0 4px;
  user-select: none;
}

.tb-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 7px;
  color: var(--text-sec);
  font-size: 0.72rem;
  font-family: inherit;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s, color 0.15s;
  height: 30px;
}
.tb-btn.tb-active    { background: rgba(110,242,182,0.12); border-color: rgba(110,242,182,0.4); color: var(--accent); }
.tb-btn.tb-minimized { border-color: rgba(255,255,255,0.06); color: #444e68; font-style: italic; }
.tb-btn.tb-closed    { display: none; }
.tb-btn:hover        { background: rgba(255,255,255,0.07); color: #c8d0e0; }

/* ============================================================
   Mobile  (phone mockup)
   ============================================================ */
@media (max-width: 768px) {
  html, body {
    height: 100dvh;
    overflow: hidden; /* device frame must not scroll */
  }

  main {
    width: 90vw;
    max-width: 420px;
    height: 92dvh;
    padding: 1.6rem 4px 4px;
    border-radius: 40px;
    border-width: 5px;
    border-color: #2a2a2a;
    /* Prevent the frame itself from overflowing */
    overflow: hidden;
  }
  main::before { top: 0.5rem; }

  #screen {
    border-radius: 32px;
    overflow: hidden;  /* clip everything to screen boundary */
    /* Override desktop gradient with Android wallpaper (particle canvas provides base) */
  }
  /* Android gradient overlay for mobile */
  #screen::before {
    background:
      radial-gradient(circle 500px at 50% 20%, rgba(6,182,212,0.18) 0%, transparent 60%),
      radial-gradient(circle 300px at 20% 80%, rgba(59,130,246,0.14) 0%, transparent 50%),
      radial-gradient(circle 400px at 80% 70%, rgba(139,92,246,0.14) 0%, transparent 50%);
  }

  /* ── Android status bar ── */
  .screen-header {
    height: 40px;
    padding: 0 12px;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
  }

  /* Hide Activities + desktop nav on mobile */
  .activities-btn,
  .activities-overlay,
  .site-nav { display: none !important; }

  /* Show hamburger on mobile */
  .mobile-menu-label { display: flex; }

  /* Show mobile hamburger label */
  .screen-header .header-left::before {
    content: '';
  }

  /* Hamburger (mobile only) */
  .menu-toggle + * + .side-menu,
  label[for="menu-toggle"] {
    /* handled by .side-menu */
  }

  .header-status { font-size: 0.75rem; gap: 3px; }
  .header-sep    { display: none; }
  .header-date   { display: none; }

  /* Show only battery + wifi on mobile tray */
  .tray-item:not(.tray-battery):not(.tray-wifi) { display: none; }
  .tray-item svg { width: 14px; height: 14px; }

  /* ── Content area ── */
  .screen-content {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.4rem 0.5rem 70px;  /* 70px clears the 62px mobile-page-nav */
    align-items: stretch;
    gap: 0;
  }

  /* Hide desktop dock on mobile */
  .dock { display: none; }

  /* ── Mobile App Cards (Android recents style) ── */

  /* Enable scroll-snapping in the content area */
  .screen-content {
    scroll-snap-type: y mandatory;
    scroll-padding-top: 0.4rem;
  }

  .mobile-card {
    scroll-snap-align: start;
    position: relative !important;
    width: 100% !important;
    min-height: calc(100dvh - 32px - 62px - 12px) !important;
    max-height: calc(100dvh - 32px - 62px - 12px) !important;
    margin: 0 0 8px 0 !important;
    border-radius: 16px !important;
    box-shadow: 0 6px 28px rgba(0,0,0,0.5) !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
  }
  .mobile-card .lw-titlebar {
    cursor: pointer;
    min-height: 40px;
    background: rgba(22,30,50,0.98);
    border-radius: 16px 16px 0 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  /* Tap hint on title bar */
  .mobile-card:not(.mobile-card--maximized) .lw-titlebar::after {
    content: 'Tap to expand';
    font-size: 0.6rem;
    color: rgba(255,255,255,0.25);
    margin-left: 8px;
  }

  /* Maximized mobile card: fills screen between header and nav */
  .mobile-card--maximized {
    position: fixed !important;
    inset: 32px 0 62px !important;
    min-height: unset !important;
    max-height: unset !important;
    width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    z-index: 99900 !important;
    transform: none !important;
  }
  .mobile-card--maximized .lw-titlebar {
    border-radius: 0;
    cursor: default;
    background: rgba(14,20,38,0.99);
  }
  .mobile-card--maximized .lw-titlebar::after { display: none; }

  /* Context menu */
  .mobile-context-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #1a2236;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    overflow: hidden;
    z-index: 10;
    min-width: 160px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  }
  .mobile-context-menu button {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    padding: 10px 16px;
    text-align: left;
    font-size: 0.85rem;
    color: #c8d0e8;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
  }
  .mobile-context-menu button:hover { background: rgba(255,255,255,0.07); }

  .mobile-menu-dots { font-size: 1rem; width: 20px; height: 20px; background: transparent; border-radius: 3px; }

  /* About layout */
  .about-layout { max-width: 100%; }
  .about-top {
    display: flex !important;
    flex-direction: column;
    gap: 0.4rem;
  }
  .about-right  { width: 100%; }
  .about-contact { width: 100%; }

  /* ── Mobile page navigator (replaces android 3-button bar) ── */
  .mobile-page-nav {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: rgba(10,14,28,0.96);
    backdrop-filter: blur(18px);
    border-top: 1px solid rgba(255,255,255,0.07);
    z-index: 99997;
    padding: 0 4px 4px;
  }
  .mpn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: #7a87a8;
    flex: 1;
    padding: 4px 0;
    transition: color 0.15s;
  }
  .mpn-icon {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: linear-gradient(145deg, var(--g1), var(--g2));
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    transition: transform 0.15s, box-shadow 0.15s;
    opacity: 0.55;
  }
  .mpn-icon svg { width: 16px; height: 16px; }
  .mpn-item span { font-size: 0.6rem; font-weight: 600; letter-spacing: 0.03em; }
  .mpn-item--active .mpn-icon { opacity: 1; transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,0.5); }
  .mpn-item--active { color: #e0e8ff; }
  .mpn-item:active .mpn-icon { transform: scale(0.9); }

  /* ── Android app dock (legacy, keep for compatibility) ── */
  .dock-pinned-mobile,
  .android-dock,
  .android-nav {
    display: none;
  }

  /* ── App manager overlay ── */
  .app-manager {
    position: absolute;  /* inside #screen */
    inset: 0;
    background: rgba(5,10,22,0.92);
    backdrop-filter: blur(20px);
    z-index: 99995;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }
  .app-manager.is-open {
    opacity: 1;
    pointer-events: auto;
  }
  .app-manager-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 16px 0 8px;
  }
  .app-manager-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }
  .app-manager-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e8eaf0;
  }
  .app-manager-close-all {
    background: transparent;
    border: 1px solid rgba(255,100,100,0.4);
    border-radius: 20px;
    color: #ff8080;
    font-size: 0.78rem;
    font-family: inherit;
    padding: 5px 14px;
    cursor: pointer;
    transition: background 0.15s;
  }
  .app-manager-close-all:hover { background: rgba(255,100,100,0.15); }

  .app-manager-cards {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .app-manager-empty {
    color: var(--text-sec);
    text-align: center;
    font-size: 0.9rem;
    margin: auto;
  }

  /* Individual app manager card */
  .app-mgr-card {
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    transition: transform 0.2s;
    cursor: pointer;
  }
  .app-mgr-card:active { transform: scale(0.97); }
  .app-mgr-card--removing {
    transform: translateY(-120%) scale(0.9);
    opacity: 0;
    transition: transform 0.28s, opacity 0.28s;
  }
  .app-mgr-preview {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }
  .app-mgr-preview-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  }
  .app-mgr-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0,0,0,0.3);
  }
  .app-mgr-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #e8eaf0;
  }
  .app-mgr-opts {
    display: flex;
    gap: 6px;
  }
  .app-mgr-opt-btn {
    width: 28px; height: 28px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    color: var(--text-sec);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
  }
  .app-mgr-opt-btn svg { width: 13px; height: 13px; }
  .app-mgr-opt-btn:hover { background: rgba(255,255,255,0.12); color: #e8eaf0; }
  .app-mgr-opt-close:hover { background: rgba(255,80,80,0.2); border-color: rgba(255,80,80,0.4); color: #ff8080; }
}

/* ── Android dock (shown on mobile only) ──
   Note: rendered inside Footer as dock-pinned, hidden on desktop */
@media (max-width: 768px) {
  .dock-pinned {
    position: absolute;  /* inside #screen which has transform */
    bottom: 0;
    left: 0; right: 0;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: rgba(10,15,30,0.92);
    backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255,255,255,0.07);
    z-index: 99996;
    padding: 0 8px;
  }
  .dock-sep    { display: none; }
  .dock-windows { display: none; }

  .dock-pin {
    flex: 1;
    max-width: 60px;
    height: 44px;
    border-radius: 10px;
    animation: none !important;
  }
  .dock-pin:hover .dock-icon-wrap { animation: none; }
  .dock-icon-wrap { width: 34px; height: 34px; }
  .dock-icon-wrap svg { width: 18px; height: 18px; }
  .dock-tooltip  { display: none; }
  .dock-pin--active .dock-icon-wrap {
    outline: 2px solid rgba(56,189,248,0.7);
    outline-offset: 2px;
  }
  .dock-pin--active::after { display: none; }

}

/* Mobile page nav + app manager only on mobile */
@media (min-width: 901px) {
  .mobile-page-nav,
  .app-manager { display: none !important; }
}
