/* =========================================================
   muzammilimtiaz.com — "laptop tabs" theme
   laptop.css — the MacBook chassis, tab strip, desk character,
   Finder toolbar/sidebar, screen viewport, progress rail, base
   ========================================================= */

/* ---------- stage / laptop ---------- */
.stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  perspective: 2000px;
}

.desk-shadow {
  position: absolute;
  left: 50%;
  bottom: 6%;
  transform: translateX(-50%);
  width: min(64vw, 900px);
  height: 60px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.55), rgba(0,0,0,0) 70%);
  filter: blur(4px);
  z-index: -1;
}

.laptop {
  position: relative;
  width: min(88vw, 1320px);
  max-width: 98vw;
}

/* aluminum lid rim around the black bezel, like a MacBook lid */
.laptop-screen-unit {
  position: relative;
  background: linear-gradient(155deg, #e6e6ea 0%, #cfcfd4 12%, #b7b7bc 50%, #cfcfd4 88%, #e6e6ea 100%);
  border-radius: 20px 20px 8px 8px;
  padding: 3px 3px 0;
  box-shadow:
    0 50px 90px var(--shadow),
    inset 0 0 0 1px rgba(255,255,255,0.5),
    inset 0 -2px 4px rgba(0,0,0,0.15);
}

/* the actual black screen bezel sits inside the aluminum rim */
.bezel {
  position: relative;
  background: linear-gradient(165deg, #232324, #131314 55%, #0c0c0d);
  border-radius: 17px 17px 5px 5px;
  padding: 12px 12px 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

/* notch, like a modern MacBook camera housing */
.notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 20px;
  background: #0c0c0d;
  border-radius: 0 0 12px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.cam-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #05070a;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), inset 0 0 3px rgba(120,200,255,0.55);
}

/* browser chrome */
.browser-chrome {
  position: relative;
  background: var(--paper-dark);
  border-radius: 10px 10px 0 0;
  padding: 8px 10px 0;
  overflow: visible;
}

.tab-strip-row {
  position: relative;
  overflow: visible;
}

.tab-strip {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  position: relative;
}
.tab-strip::-webkit-scrollbar { display: none; }

.tab {
  --tab-open: 0;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  width: calc(var(--tab-w) * var(--tab-open));
  min-width: 0;
  max-width: var(--tab-w);
  overflow: hidden;
  opacity: var(--tab-open);
  padding: 9px 10px;
  border: none;
  border-radius: 8px 8px 0 0;
  background: var(--paper-line);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transform: translateY(calc((1 - var(--tab-open)) * 6px));
  transition: width 0.5s cubic-bezier(.2,.9,.3,1.2), opacity 0.4s ease, background 0.25s ease, color 0.25s ease, transform 0.4s ease;
}

.tab.revealed { --tab-open: 1; }

.tab .tab-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-faint);
  flex: 0 0 auto;
}

.tab .tab-label { overflow: hidden; text-overflow: ellipsis; }
.tab .tab-close { margin-left: auto; opacity: 0; font-size: 13px; }
.tab:hover .tab-close { opacity: 0.6; }

.tab.is-active {
  background: var(--paper);
  color: var(--ink);
}
.tab.is-active .tab-dot { background: var(--accent); }

.tab.just-opened {
  animation: tabPop 0.55s cubic-bezier(.2,.9,.3,1.3);
}
@keyframes tabPop {
  0% { transform: translateY(-10px) scaleX(0.4); opacity: 0; }
  60% { transform: translateY(2px) scaleX(1.04); opacity: 1; }
  100% { transform: translateY(0) scaleX(1); opacity: 1; }
}

/* ---------- tiny developer living inside the browser chrome ---------- */
/* sits behind the laptop lid in DOM/stacking order, so the lid's top edge
   naturally occludes its lower body — only the head and hands peek out above it */
.desk-character {
  position: absolute;
  left: 50%;
  top: -46px;
  transform: translateX(-50%);
  width: min(8vw, 74px);
  pointer-events: none;
  transition: left 0.55s cubic-bezier(.32, .85, .3, 1.05);
}

.char-svg { width: 100%; height: auto; display: block; overflow: visible; }

/* idle breathing / bob while perched on the tab edge */
.char-head-group {
  transform-origin: 45px 20px;
  animation: charIdleBob 3.6s ease-in-out infinite;
}
@keyframes charIdleBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-1.4px) rotate(-1.2deg); }
}

.char-body {
  transform-origin: 45px 76px;
  animation: charSway 4.2s ease-in-out infinite;
}
@keyframes charSway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(0.8deg); }
}

/* blinking behind the glasses */
.char-eye {
  transform-origin: center;
  animation: charBlink 5.2s ease-in-out infinite;
}
.char-eye-r { animation-delay: 0.05s; }
@keyframes charBlink {
  0%, 90%, 100% { transform: scaleY(1); }
  94% { transform: scaleY(0.12); }
}

/* resting positions */
.char-arm-l-group { transform-origin: 24px 46px; }
.char-arm-r-group { transform-origin: 66px 46px; }
.char-leg-l { transform-origin: 32.5px 70px; }
.char-leg-r { transform-origin: 57.5px 70px; }

/* legs swing lazily while sitting on the tab edge */
.char-leg-l { animation: legSwingL 2.6s ease-in-out infinite; }
.char-leg-r { animation: legSwingR 2.6s ease-in-out infinite 0.3s; }
@keyframes legSwingL {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(8deg); }
}
@keyframes legSwingR {
  0%, 100% { transform: rotate(6deg); }
  50% { transform: rotate(-8deg); }
}

/* legs kick faster while shifting over to a newly opened tab */
.desk-character.walking .char-leg-l { animation: legKickL 0.28s ease-in-out infinite; }
.desk-character.walking .char-leg-r { animation: legKickR 0.28s ease-in-out infinite 0.14s; }
@keyframes legKickL {
  0%, 100% { transform: rotate(-20deg); }
  50% { transform: rotate(20deg); }
}
@keyframes legKickR {
  0%, 100% { transform: rotate(20deg); }
  50% { transform: rotate(-20deg); }
}
.desk-character.walking .char-head-group {
  animation: charIdleBob 3.6s ease-in-out infinite, charBob 0.28s ease-in-out infinite;
}
@keyframes charBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

/* arms reach up and grab the tab, direction leans with scroll */
.desk-character.pull-down .char-arm-l-group,
.desk-character.pull-down .char-arm-r-group {
  animation: armReachDown 0.6s ease;
}
.desk-character.pull-up .char-arm-l-group,
.desk-character.pull-up .char-arm-r-group {
  animation: armReachUp 0.6s ease;
}
@keyframes armReachDown {
  0% { transform: rotate(0deg); }
  35% { transform: rotate(-70deg); }
  70% { transform: rotate(-15deg); }
  100% { transform: rotate(0deg); }
}
@keyframes armReachUp {
  0% { transform: rotate(0deg); }
  35% { transform: rotate(70deg); }
  70% { transform: rotate(15deg); }
  100% { transform: rotate(0deg); }
}

.new-tab-plus {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint);
  font-size: 15px;
  margin-bottom: 4px;
}

.address-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border-radius: 8px;
  margin: 8px 0 10px;
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
}
.address-bar .lock { font-size: 11px; }
.address-bar .url { color: var(--ink); }

/* ---------- finder-style chrome: breadcrumb toolbar + favorites sidebar ---------- */
.finder-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  background: var(--paper-dark);
  border-top: 1px solid var(--paper-line);
  border-bottom: 1px solid var(--paper-line);
}
.finder-crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  flex-wrap: wrap;
  min-width: 0;
}
.crumb-icon { font-size: 12px; }
.crumb-sep { color: var(--paper-line); }
.crumb-current { color: var(--ink); font-weight: 600; }
.finder-view-toggle { display: flex; gap: 4px; flex: 0 0 auto; }
.view-icon {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 5px;
  font-size: 12px;
  color: var(--ink-faint);
}
.view-icon.active {
  background: var(--paper);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--paper-line);
}

.finder-body { display: flex; align-items: stretch; }

.finder-sidebar {
  width: 152px;
  flex: 0 0 152px;
  background: var(--paper-dark);
  border-right: 1px solid var(--paper-line);
  padding: 10px 8px;
  overflow-y: auto;
}
.sidebar-heading {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 6px 8px 4px;
}
.sidebar-tags-heading { margin-top: 10px; }
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  padding: 6px 8px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-item:hover { background: var(--on-desk-hover); }
.sidebar-item.active { background: var(--accent); color: #fff8ee; }
.sidebar-icon { font-size: 13px; flex: 0 0 auto; }
.sidebar-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  font-size: 12px;
  color: var(--ink-soft);
  font-family: var(--font-sans);
}
.tag-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.tag-dot-rust { background: var(--accent); }
.tag-dot-green { background: var(--accent-2); }
.tag-dot-blue { background: #4a7fb5; }
.tag-dot-ai { background: var(--accent-2); box-shadow: 0 0 0 3px rgba(47, 111, 79, 0.18); }

/* screen body */
.screen-body {
  position: relative;
  flex: 1;
  min-width: 0;
  background: var(--paper);
  height: 66vh;
  min-height: 420px;
  max-height: 780px;
  overflow: hidden;
  background-image:
    linear-gradient(var(--paper-line) 1px, transparent 1px);
  background-size: 100% 34px;
}

.panel {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.99);
  transition: opacity 0.45s ease, transform 0.55s cubic-bezier(.2,.8,.3,1);
}
.panel.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.panel.leaving-up { transform: translateY(-16px) scale(0.99); opacity: 0; }
.panel.leaving-down { transform: translateY(16px) scale(0.99); opacity: 0; }

.panel-scroll {
  height: 100%;
  overflow-y: hidden;
  padding: 26px clamp(20px, 4vw, 56px) 30px;
}

/* progress rail */
.progress-rail {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--paper-line);
}
.progress-fill {
  height: 100%;
  width: 12.5%;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  transition: width 0.5s cubic-bezier(.2,.8,.3,1);
}

/* laptop base — aluminum keyboard deck peeking out below the screen, MacBook-style */
.laptop-base {
  position: relative;
  height: 26px;
  background: linear-gradient(180deg, #d9d9dd 0%, #c3c3c8 35%, #a9a9ae 100%);
  border-radius: 0 0 10px 10px;
  box-shadow:
    0 30px 40px var(--shadow),
    inset 0 1px 0 rgba(255,255,255,0.7);
  transform-origin: top center;
}
/* hinge notch */
.laptop-base::before {
  content: '';
  position: absolute;
  left: 50%; top: 0;
  transform: translateX(-50%);
  width: 26%;
  height: 6px;
  background: #8f8f94;
  border-radius: 0 0 6px 6px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.35);
}
/* trackpad notch cut into the front lip */
.laptop-base .trackpad {
  display: block;
  position: absolute;
  left: 50%; bottom: 2px;
  transform: translateX(-50%);
  width: 16%;
  min-width: 90px;
  height: 5px;
  background: #9a9a9f;
  border-radius: 3px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}
.hinge { display: none; }
