/* Interactive MacBook desktop — Hybrid Industries */

:root {
  --mac-bg: #0d0d0d;
  --mac-screen-radius: 14px;
  --mac-bezel: #1a1a1a;
  --menubar-h: clamp(34px, 3.2vh, 44px);
  --dock-h: clamp(88px, 9vh, 120px);
  --accent: #007aff;
  --window-bg: rgba(30, 30, 30, 0.92);
  --window-border: rgba(255, 255, 255, 0.1);
  --text: #f5f5f7;
  --text-muted: #98989d;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --mac-chrome-h: 34px; /* notch-base + base */
}

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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  background: radial-gradient(ellipse at 50% 30%, #1a1a2e 0%, #0a0a0a 60%, #000 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

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

/* ─── Scene ─── */
.scene {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
}

.scene__hint {
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  z-index: 10;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.65;
  pointer-events: none;
}

.scene__hint a {
  pointer-events: auto;
}

.scene__hint a {
  color: rgba(255,255,255,0.6);
}

.scene__hint a:hover { color: #fff; text-decoration: none; }

/* ─── MacBook chassis — nearly full viewport ─── */
.macbook {
  width: 99vw;
  height: calc(100dvh - 8px);
  max-height: calc(100dvh - 8px);
  display: flex;
  flex-direction: column;
  filter: drop-shadow(0 16px 48px rgba(0,0,0,0.5));
}

.macbook__screen-wrap {
  background: var(--mac-bezel);
  border-radius: clamp(12px, 1.2vw, 20px) clamp(12px, 1.2vw, 20px) 0 0;
  padding: clamp(10px, 1vw, 16px) clamp(10px, 1vw, 16px) 0;
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.macbook__camera {
  width: 10px;
  height: 10px;
  background: #2a2a2a;
  border-radius: 50%;
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: inset 0 0 2px rgba(255,255,255,0.1);
}

.macbook__screen {
  flex: 1;
  min-height: 0;
  width: 100%;
  border-radius: var(--mac-screen-radius) var(--mac-screen-radius) 0 0;
  overflow: hidden;
  position: relative;
  background: #000;
  user-select: none;
}

.macbook__base {
  height: clamp(14px, 1.6vh, 22px);
  flex-shrink: 0;
  background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 40%, #0f0f0f 100%);
  border-radius: 0 0 clamp(10px, 1vw, 16px) clamp(10px, 1vw, 16px);
  position: relative;
}

.macbook__base::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(120px, 12vw, 220px);
  height: clamp(4px, 0.5vh, 6px);
  background: #333;
  border-radius: 0 0 4px 4px;
}

.macbook__notch-base {
  width: clamp(140px, 14vw, 240px);
  height: clamp(6px, 0.7vh, 10px);
  flex-shrink: 0;
  background: #222;
  margin: 0 auto;
  border-radius: 0 0 8px 8px;
}

/* ─── Wallpaper ─── */
.wallpaper {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(88, 86, 214, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(255, 45, 85, 0.25) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, rgba(10, 132, 255, 0.2) 0%, transparent 60%),
    linear-gradient(160deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
}

/* ─── Menu bar ─── */
.menubar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--menubar-h);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 500;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.menubar__left,
.menubar__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menubar__apple {
  font-size: 15px;
  opacity: 0.9;
}

.menubar__brand {
  font-weight: 600;
}

.menubar__item {
  color: rgba(255,255,255,0.85);
  cursor: default;
}

.menubar__clock {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: rgba(255,255,255,0.85);
}

/* ─── Desktop icons ─── */
.desktop {
  position: absolute;
  inset: var(--menubar-h) 0 var(--dock-h) 0;
  z-index: 1;
}

.desktop-icons {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 12px;
  padding: 20px;
  height: 100%;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 96px;
  padding: 10px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  background: none;
  color: inherit;
  font-family: inherit;
}

.desktop-icon:hover {
  background: rgba(255,255,255,0.08);
}

.desktop-icon.selected {
  background: rgba(0, 122, 255, 0.35);
}

.desktop-icon__img {
  width: clamp(56px, 6vh, 80px);
  height: clamp(56px, 6vh, 80px);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(28px, 3.2vh, 42px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.desktop-icon__img--folder {
  background: linear-gradient(180deg, #64b5f6 0%, #1976d2 100%);
}

.desktop-icon__img--about {
  background: linear-gradient(180deg, #81c784 0%, #388e3c 100%);
}

.desktop-icon__img--projects {
  background: linear-gradient(180deg, #ffb74d 0%, #f57c00 100%);
}

.desktop-icon__label {
  font-size: 12px;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  line-height: 1.2;
  word-break: break-word;
}

/* ─── Dock ─── */
.dock-wrap {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 200;
  pointer-events: none;
}

.dock {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 22px;
  pointer-events: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.dock__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: transform 0.2s var(--ease);
}

.dock__item:hover {
  transform: translateY(-10px) scale(1.18);
}

/* macOS-style hover label bubble */
.dock__item::before {
  content: attr(data-label);
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(45, 45, 48, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f5f5f7;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: 7px;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s var(--ease), transform 0.15s var(--ease);
}

.dock__item:hover::before,
.dock__item:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.dock__item.is-open::after {
  content: '';
  width: 4px;
  height: 4px;
  background: rgba(255,255,255,0.7);
  border-radius: 50%;
  position: absolute;
  bottom: -6px;
}

.dock__icon {
  width: clamp(52px, 5.5vh, 72px);
  height: clamp(52px, 5.5vh, 72px);
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(26px, 2.8vh, 36px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.dock__divider {
  width: 1px;
  height: 48px;
  background: rgba(255,255,255,0.2);
  margin: 0 4px;
}

.dock__icon--finder { background: linear-gradient(180deg, #5ac8fa 0%, #007aff 100%); }
.dock__icon--safari { background: linear-gradient(180deg, #5ac8fa 0%, #007aff 100%); border-radius: 50%; }
.dock__icon--mail { background: linear-gradient(180deg, #5ac8fa 0%, #007aff 100%); }
.dock__icon--terminal { background: linear-gradient(180deg, #3a3a3a 0%, #1a1a1a 100%); }
.dock__icon--builtnearby { background: linear-gradient(180deg, #667eea 0%, #764ba2 100%); }
.dock__icon--trash { background: linear-gradient(180deg, #8e8e93 0%, #636366 100%); font-size: 22px; }

/* ─── Windows ─── */
.windows {
  position: absolute;
  inset: var(--menubar-h) 0 var(--dock-h) 0;
  z-index: 50;
  pointer-events: none;
}

.window {
  position: absolute;
  width: min(560px, 42vw);
  background: var(--window-bg);
  backdrop-filter: blur(40px) saturate(150%);
  -webkit-backdrop-filter: blur(40px) saturate(150%);
  border: 1px solid var(--window-border);
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05) inset;
  overflow: hidden;
  pointer-events: auto;
  opacity: 0;
  transform: scale(0.92) translateY(10px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  display: none;
}

.window.is-open {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: scale(1) translateY(0);
}

.window.is-minimized {
  opacity: 0;
  transform: scale(0.5) translateY(100px);
  pointer-events: none;
}

.window--wide {
  width: min(720px, 52vw);
}

.window__titlebar {
  height: 44px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  cursor: grab;
  flex-shrink: 0;
  touch-action: none;
}

.window__titlebar:active { cursor: grabbing; }

.window__traffic {
  display: flex;
  gap: 7px;
}

.window__traffic button {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: filter 0.15s;
}

.window__traffic button:hover { filter: brightness(1.15); }

.window__close { background: #ff5f57; }
.window__minimize { background: #febc2e; }
.window__maximize { background: #28c840; }

.window__title {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  margin-right: 58px;
}

.window__content {
  padding: 24px;
  overflow-y: auto;
  max-height: min(520px, 58vh);
  font-size: clamp(13px, 1.4vh, 16px);
  line-height: 1.5;
  color: rgba(255,255,255,0.85);
}

.window__content h2 {
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.window__content p {
  margin-bottom: 10px;
  color: var(--text-muted);
}

.window__content ul {
  margin: 8px 0 12px 18px;
  color: var(--text-muted);
}

/* Projects grid in window */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: inherit;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.project-row:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(0,122,255,0.3);
  text-decoration: none;
}

.project-row__icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.project-row__info { flex: 1; min-width: 0; }
.project-row__name { font-weight: 600; font-size: 14px; color: var(--text); }
.project-row__desc { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-row__arrow { color: var(--text-muted); font-size: 14px; }

/* Contact form */
.mac-form label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.mac-form input,
.mac-form textarea {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 12px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}

.mac-form input:focus,
.mac-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.mac-form textarea { min-height: 80px; resize: vertical; }

.mac-form button {
  width: 100%;
  padding: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.mac-form button:hover { background: #0066d6; }

/* Terminal window */
.terminal {
  background: rgba(20, 20, 20, 0.95);
  font-family: "SF Mono", "Menlo", "Monaco", monospace;
  font-size: 12px;
  line-height: 1.6;
  padding: 16px;
  color: #39ff14;
}

.terminal .prompt { color: #5ac8fa; }
.terminal .cmd { color: #fff; }
.terminal .output { color: #98989d; margin-bottom: 8px; }

@media (max-width: 640px) {
  .macbook { width: 100vw; }
  .menubar__item { display: none; }
  .menubar__brand { font-size: 12px; }
  .window { width: 94% !important; left: 3% !important; }
}
