@font-face {
  font-family: 'Gambarino';
  src: url('fonts/Gambarino-Regular.woff2') format('woff2'),
       url('fonts/Gambarino-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'General Sans';
  src: url('fonts/GeneralSans-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', system-ui, sans-serif;
  --font-serif: 'Gambarino', Georgia, serif;
  --font-sans: 'General Sans', -apple-system, sans-serif;
  --menu-height: 28px;
  --dock-height: 62px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: url('assets/Desktop Wallpaper.png') center/cover no-repeat;
  color: #fff;
  -webkit-font-smoothing: antialiased;
}

/* ==============================
   MENU BAR
   ============================== */
.menu-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--menu-height);
  z-index: 100;
  user-select: none;
}

.menu-bar-bg {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
}

.menu-bar-bg::after {
  content: '';
  position: absolute; inset: 0;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
}

.menu-bar-content {
  position: relative; z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 12px;
}

.menu-bar-left { display: flex; align-items: center; gap: 0; }
.menu-bar-right { display: flex; align-items: center; gap: 0; }

.mb-img {
  height: 24px;
  width: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.menu-clock {
  font-size: 13px; font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-left: 2px;
}

/* ==============================
   DESKTOP
   ============================== */
.desktop {
  position: fixed;
  top: var(--menu-height);
  left: 0; right: 0;
  bottom: var(--dock-height);
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 12px;
  z-index: 2;
}

/* ==============================
   RIGHT COLUMN (Message + Keys)
   ============================== */
.right-column {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 3;
}

/* ==============================
   BROWSER WINDOW
   ============================== */
.browser-window {
  flex: 0 1 540px;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  position: relative;
  z-index: 1;
  border: 0.5px solid rgba(0, 0, 0, 0.15);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.3),
    0 0 0 0.5px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.browser-titlebar {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 12px;
  background: #e8e6e8;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.traffic-lights {
  display: flex;
  gap: 7px;
  margin-right: 12px;
  flex-shrink: 0;
}

.tl-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.tl-close { background: #ff5f57; }
.tl-minimize { background: #febc2e; }
.tl-maximize { background: #28c840; }

.browser-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.browser-tab {
  display: flex;
  align-items: center;
  height: 26px;
  padding: 0 14px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 6px;
  max-width: 200px;
}

.browser-tab.active {
  background: #fff;
}

.tab-title {
  font-size: 11.5px;
  color: rgba(0, 0, 0, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-new {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  font-size: 16px;
  color: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.browser-toolbar {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 10px;
  gap: 8px;
  background: #f5f5f5;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.nav-buttons {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.url-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  background: #fff;
  border-radius: 6px;
  border: 0.5px solid rgba(0, 0, 0, 0.12);
}

.url-text {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toolbar-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.browser-bookmarks {
  display: flex;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  gap: 16px;
  background: #f5f5f5;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.bookmark-item {
  font-size: 11px;
  color: rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

.browser-content {
  flex: 1;
  background: #fff;
  position: relative;
  overflow: hidden;
}

.browser-tab-panel {
  display: none;
  width: 100%;
  height: 100%;
}

.browser-tab-panel.active {
  display: block;
}

.browser-tab[data-tab] {
  cursor: pointer;
  user-select: none;
}

.tab-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8e8e93;
  display: inline-block;
  margin-right: 4px;
  flex-shrink: 0;
}

.tab-live-dot.live {
  background: #ff3b30;
  box-shadow: 0 0 5px rgba(255, 59, 48, 0.5);
  animation: live-pulse 1.5s infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ==============================
   ABOUT PAGE (inside browser window)
   ============================== */
.about-page {
  padding: 36px 32px 48px;
  overflow-y: auto;
  height: 100%;
  font-family: var(--font-sans);
  color: #2A2725;
  background: oklch(98.5% 0.001 106.423);
}

.about-section {
  margin-bottom: 32px;
}

.about-section:last-child {
  margin-bottom: 0;
}

.about-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 16px;
  color: #2A2725;
  letter-spacing: -0.025em;
}

.about-subtitle {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: #6B6560;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.about-text {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.55;
  color: #2A2725;
  letter-spacing: -0.01em;
}

.cutout {
  display: inline;
  white-space: normal;
}

/* Cutout hover effects */
.about-text .cutout:hover span:nth-child(odd) {
  transform: rotate(var(--rot)) translateY(calc(var(--y) - 2px)) scale(1.04);
}

.about-text .cutout:hover span:nth-child(even) {
  transform: rotate(var(--rot)) translateY(calc(var(--y) + 1.5px)) scale(1.06);
}

.status-indicators {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #A8A29D;
}

.status-dot.online {
  background: #008B6E;
  box-shadow: 0 0 6px rgba(0, 139, 110, 0.4);
}

.status-dot.offline {
  background: #F5542E;
}

.status-label {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: #6B6560;
}

.status-label strong {
  color: #2A2725;
  font-weight: 600;
}

.status-viewers-icon {
  font-size: 14px;
  flex-shrink: 0;
  line-height: 1;
}


/* ==============================
   DOCK
   ============================== */
.dock {
  position: fixed;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
}

.dock-inner {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-radius: 18px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.dock-icon {
  width: 42px; height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.dock-icon img {
  width: 42px; height: 42px;
  border-radius: 10px;
  user-select: none;
  -webkit-user-drag: none;
}

.dock-icon:hover {
  transform: scale(1.15) translateY(-4px);
}

.dock-separator {
  display: flex;
  align-items: center;
  margin: 0 2px;
}

.dock-sep-img {
  height: 41px;
  width: auto;
  opacity: 0.3;
}


/* ==============================
   BRIGHTNESS OVERLAY
   ============================== */
.brightness-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 115;
  transition: opacity 0.15s ease-out;
}


/* ==============================
   OSD (Brightness / Volume indicator)
   ============================== */
.osd {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 200px; height: 200px;
  background: rgba(232, 232, 236, 0.96);
  backdrop-filter: blur(30px) saturate(150%);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 120;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
  transition: opacity 0.2s ease;
}

/* OSD visibility controlled via inline styles (JS) */

.osd-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.osd-segments {
  display: flex;
  gap: 2px;
  padding: 0 24px;
}

.osd-seg {
  width: 8px; height: 8px;
  border-radius: 1.5px;
  background: rgba(0, 0, 0, 0.08);
  transition: background 0.1s;
}

.osd-seg.filled {
  background: rgba(0, 0, 0, 0.35);
}


/* ==============================
   MESSAGE WINDOW (iMessage)
   ============================== */
.msg-window {
  flex: 1;
  min-height: 0;
  background: #fff;
  border-radius: 10px;
  border: 0.5px solid rgba(0, 0, 0, 0.15);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.25),
    0 0 0 0.5px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.msg-titlebar {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  background: #e8e6e8;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.msg-titlebar .traffic-lights {
  margin-right: 8px;
}

.msg-titlebar .tl-dot {
  width: 10px;
  height: 10px;
}

.msg-title {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.7);
}

.msg-info-icon {
  flex-shrink: 0;
  opacity: 0.5;
}

.msg-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: flex-end;
}

.msg-bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.35;
  word-wrap: break-word;
}

.msg-bubble.received {
  background: #e9e9eb;
  color: #000;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.msg-bubble.sent {
  background: #007aff;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.msg-emoji {
  width: 1.2em;
  height: 1.2em;
  vertical-align: -0.15em;
  display: inline;
}

.msg-input-bar {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  background: #fff;
  border-top: 0.5px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.msg-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  background: #f0f0f0;
  border-radius: 15px;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
}

.msg-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font);
  font-size: 13px;
  color: #000;
}

.msg-input-wrap input::placeholder {
  color: rgba(0, 0, 0, 0.3);
}

/* ==============================
   GROUP CHAT STYLES
   ============================== */
.msg-group-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.msg-group-wrapper.own {
  align-items: flex-end;
}

.msg-sender-name {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 2px;
  padding-left: 4px;
}

.msg-bubble.summer {
  background: #d4e4ff;
  color: #000;
}


/* ==============================
   STREAM (inside browser tab panel)
   ============================== */

.stream-body {
  width: 100%;
  height: 100%;
  background: #f5f5f5;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.stream-body.streaming {
  background: #1a1a1a;
}

.stream-body video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.stream-offline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.stream-offline-text {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.35);
  font-family: var(--font);
}

.stream-body.streaming .stream-offline-text {
  color: rgba(255, 255, 255, 0.4);
}

.stream-start-btn {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 20px;
  background: #ff5a5f;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  z-index: 2;
}

.stream-start-btn:hover { background: #e04e53; }

/* ==============================
   KEYS WINDOW (small browser)
   ============================== */
.keys-window {
  flex-shrink: 0;
  background: #fff;
  border-radius: 10px;
  border: 0.5px solid rgba(0, 0, 0, 0.15);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.25),
    0 0 0 0.5px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.keys-titlebar {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 10px;
  background: #e8e6e8;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  gap: 8px;
}

.keys-titlebar .traffic-lights {
  margin-right: 4px;
}

.keys-titlebar .tl-dot {
  width: 10px;
  height: 10px;
}

.keys-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  background: #fff;
  border-radius: 5px;
  flex: 1;
  min-width: 0;
}

.keys-tab-title {
  font-size: 10.5px;
  color: rgba(0, 0, 0, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.keys-tab-close {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.25);
  line-height: 1;
}

.keys-tab-new {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.25);
}

.keys-toolbar {
  display: flex;
  align-items: center;
  height: 28px;
  padding: 0 8px;
  gap: 6px;
  background: #f5f5f5;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.keys-url-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 8px;
  background: #fff;
  border-radius: 5px;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
}

.keys-url-bar span {
  font-size: 10.5px;
  color: rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

.keys-content {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.keys-heading {
  font-size: 13px;
  font-weight: 600;
  color: #1d1d1f;
  text-align: center;
  margin-bottom: 4px;
}

.keys-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.key-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 8px;
  transition: transform 0.08s ease;
  user-select: none;
  -webkit-user-drag: none;
  outline: none;
}

.key-btn img {
  width: 56px;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.key-btn:active,
.key-btn.pressed {
  transform: translateY(3px);
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 960px) {
  .browser-window {
    flex: 1 1 auto;
    max-width: none;
  }

  .right-column {
    width: 280px;
  }
}

@media (max-width: 768px) {
  .menu-bar { display: none; }
  .dock { display: none; }

  .desktop {
    top: 0;
    bottom: 0;
    padding: 0;
    flex-direction: column;
    gap: 6px;
  }

  .browser-window {
    flex: 1 1 auto;
    min-height: 0;
    max-width: none;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  .right-column {
    width: 100%;
    flex-direction: row;
    gap: 6px;
    padding: 0 6px 6px;
    max-height: 35vh;
    flex-shrink: 0;
  }

  .msg-window {
    flex: 2;
    min-height: 0;
  }

  .keys-window {
    flex: 1;
    min-width: 0;
  }

  .key-btn {
    padding: 6px;
  }

  .key-btn img {
    width: 48px;
  }

  .keys-content {
    padding: 10px 8px 12px;
    gap: 6px;
  }

  .keys-heading {
    font-size: 11px;
    margin-bottom: 2px;
  }

  .keys-row {
    gap: 4px;
  }

  .mute-btn {
    display: none;
  }

  .osd {
    width: 140px; height: 140px;
    border-radius: 16px;
  }
  .osd-icon-wrap svg { width: 40px; height: 40px; }
  .osd-seg { width: 6px; height: 6px; }
  .osd-segments { gap: 2px; padding: 0 14px; }
}
