@font-face {
  font-family: "Silver";
  src:
    url("static/Silver.woff2") format("woff2"),
    url("static/Silver.woff") format("woff");
  font-weight: normal;
  font-style: normal;
}

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

html,
body {
  height: 100%;
  background: #141013;
  color: #ccc;
  font-family: "Silver", monospace, sans-serif;
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0.03em;
}

p + p {
  margin-top: 16px;
}

/* ─── Device exit link ────────────────────────────── */

.device-exit {
  display: block;
  text-align: center;
  padding: 12px;
  color: #666;
  font-family: "Silver", monospace;
  font-size: 22px;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: color 0.15s;
}

.device-exit:hover { color: #fff; }

/* ─── Layout (home) ───────────────────────────────── */

.layout {
  display: flex;
  min-height: 100vh;
}

/* ─── Phone Wrap ──────────────────────────────────── */

.phone-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 32px 16px;
}

.phone {
  width: 100%;
  max-width: 390px;
}

.phone-frame {
  background: #141013;
  border: 2px solid #333;
  padding: 16px 0 16px;
}

/* ─── App Grid ────────────────────────────────────── */

.app-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px 8px;
  padding: 8px 16px;
}

.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}

.app:active .app-icon {
  opacity: 0.75;
}

.app-icon {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Silver", monospace;
  font-size: clamp(24px, 7vw, 36px);
  color: #fff;
  transition: opacity 0.1s;
}

.app-icon img {
  width: 65%;
  height: 65%;
  filter: brightness(0) invert(1);
  image-rendering: pixelated;
}

.app-name {
  font-family: "Silver", monospace;
  font-size: clamp(16px, 5vw, 22px);
  letter-spacing: 0.04em;
  text-align: center;
  color: #e5e5e5;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-dummy {
  pointer-events: none;
  opacity: 0.25;
  filter: grayscale(1);
}

/* ─── Inner Pages ─────────────────────────────────── */

.page-nav {
  display: flex;
  align-items: center;
  padding: 20px 20px 12px;
  border-bottom: 2px solid #222;
  flex-shrink: 0;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #aaa;
  text-decoration: none;
  font-family: "Silver", monospace;
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0.05em;
  transition: color 0.15s;
}

.back-btn:hover {
  color: #fff;
}

.back-arrow {
  font-size: 32px;
  line-height: 1;
}

.page-title {
  flex: 1;
  text-align: center;
  font-family: "Silver", monospace;
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding-right: 60px;
}

.page-content {
  flex: 1;
  padding: 24px 20px;
  overflow-y: auto;
}

.page-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  gap: 16px;
  text-align: center;
}

.page-placeholder-icon {
  font-size: 112px;
  opacity: 0.3;
  font-family: "Silver", monospace;
  color: #fff;
}

.page-placeholder-text {
  font-family: "Silver", monospace;
  font-size: 32px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #444;
}

.spotify-embed {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0;
}

.spotify-embed + .spotify-embed {
  margin-top: 16px;
}

/* ─── Desktop note (hidden on mobile) ────────────── */

.desktop-note {
  display: none;
}

/* ─── Desktop ─────────────────────────────────────── */

@media (min-width: 768px) {
  .desktop-note {
    display: block;
    position: fixed;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    border: 2px solid #fff;
    padding: 16px 20px;
    background: #141013;
    z-index: 100;
    max-width: 180px;
  }

  .phone-wrap {
    padding: 40px;
  }

  /* No phone chrome on desktop */
  .phone-frame {
    border: none;
    background: transparent;
    padding: 0;
  }

  .app-icon {
    font-size: clamp(18px, 2.5vw, 32px);
  }

  .app-name {
    font-size: clamp(12px, 1.2vw, 18px);
  }

  /* Sub-pages: no phone chrome on desktop */
  .page-frame {
    border: none;
    background: transparent;
    padding: 0;
  }
}

/* ─── Mobile: fill viewport ───────────────────────── */

@media (max-width: 440px) {
  .phone-wrap {
    padding: 0;
  }

  .phone {
    max-width: 100%;
  }

  .phone-frame {
    border-left: none;
    border-right: none;
    min-height: 100vh;
  }
}
