/* Mobile version: a Pocket PC in XP Silver. Everything is scoped to .mobile (set by boot.js). */
.mobile {
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  --left: env(safe-area-inset-left, 0px);
  --right: env(safe-area-inset-right, 0px);
  --tabs: calc(64px + var(--bottom));
  --mini: 0px;
  font-size: 16px;
  background: #b9bbcd;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.mobile.has-track:not([data-screen='music']) { --mini: 56px; }
.mobile body { overflow: hidden; touch-action: manipulation; -webkit-tap-highlight-color: rgb(49 106 197 / .25); }

/* Desktop-only furniture */
.mobile .wallpaper,
.mobile .icons,
.mobile .taskbar,
.mobile .start-menu,
.mobile .controls,
.mobile .menubar,
.mobile .address,
.mobile .pane,
.mobile .tab,
.mobile .pc { display: none; }

/* One screen at a time */
.mobile #desktop { position: fixed; inset: 0 0 calc(var(--tabs) + var(--mini)); padding: 0; overflow: hidden; }
.mobile .window {
  position: absolute; inset: 0 !important; z-index: auto !important;
  width: auto !important; height: auto !important; max-width: none !important; max-height: none !important;
  margin: 0; border: 0; border-radius: 0; box-shadow: none; resize: none;
}
.mobile .body {
  flex: 1 1 0; padding: 16px max(16px, var(--right)) 24px max(16px, var(--left));
  overscroll-behavior: contain;
}

/* Title bar */
.mobile .bar {
  position: relative; height: calc(52px + var(--top));
  padding: var(--top) max(8px, var(--right)) 0 max(8px, var(--left));
  justify-content: center; background: var(--title); border-bottom: 1px solid #73748c;
}
.mobile .bar > svg { width: 26px; height: 26px; }
.mobile .bar h1, .mobile .bar h2 { flex: 0 1 auto; color: #0e1010; font-size: 18px; }
.mobile .bar .back {
  position: absolute; left: max(6px, var(--left)); bottom: 4px;
  width: auto; min-width: 44px; height: 44px; padding: 0 8px 0 24px;
  border: 0; box-shadow: none; background: none; font-size: 14px;
}
.desktop .back, html:not(.js) .back { display: none; }
.mobile .bar .back::before {
  left: 9px; top: 17px; width: 10px; height: 10px;
  border: solid #33344a; border-width: 0 0 3px 3px; transform: rotate(45deg);
}
.mobile .window:not(.home) .bar > svg { display: none; }

/* Today */
.mobile .home { display: flex; overflow-y: auto; background: #e0dfe3; }
.mobile .home[hidden] { display: none !important; }
.mobile .home .bar { position: sticky; top: 0; z-index: 2; }
.mobile .today {
  flex: none; display: flex; flex-direction: column; justify-content: center;
  min-height: 150px; padding: 18px max(20px, var(--left));
  color: #fff; text-shadow: 1px 1px 4px rgb(0 0 0 / .85);
  background: linear-gradient(90deg, rgb(0 20 60 / .3), transparent 70%), #3579c4 url('img/hill.jpg') 78% 52% / cover;
}
.mobile .today strong { font: 400 52px/1.1 'Trebuchet MS', Tahoma, sans-serif; white-space: nowrap; }
.mobile .today span { font-size: 17px; }
.mobile .banner { padding: 10px max(16px, var(--right)) 10px max(16px, var(--left)); }
.mobile .banner svg { display: none; }
.mobile .banner strong { display: none; }
.mobile .home .body { flex: none; padding: 0; overflow: visible; }
.mobile .home .body > p:first-child {
  margin: 0; padding: 12px max(16px, var(--right)) 12px max(16px, var(--left));
  color: var(--muted); font-size: 14px; background: #f0f1f6;
}
.mobile .menu .mobile-only { display: list-item; }
.mobile .menu li { border-top: 1px solid #d8d9e3; }
.mobile .menu a {
  position: relative; min-height: 62px; gap: 14px;
  padding: 8px 40px 8px max(16px, var(--left));
}
.mobile .menu a::after {
  content: ''; position: absolute; right: max(18px, var(--right)); top: calc(50% - 5px);
  width: 9px; height: 9px; border: solid #777891; border-width: 2px 2px 0 0; transform: rotate(45deg);
}
.mobile .menu a:hover { color: var(--ink); background: none; }
.mobile .menu a:hover small { color: var(--muted); background: none; }
.mobile .menu a:active { background: #dfe6f5; }
.mobile .menu small { font-size: 13px; }
.mobile .socials {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin: 0; padding: 14px max(16px, var(--right)) 18px max(16px, var(--left));
  background: #e0dfe3; border-top: 1px solid #a5a6bb;
}
.mobile .socials a {
  display: flex; align-items: center; justify-content: center; min-height: 46px;
  color: var(--ink); text-decoration: none;
  border: 1px solid #55567a; border-radius: 4px; background: var(--silver-button);
}

/* Projects */
.mobile .explorer { display: block; padding: 12px max(12px, var(--right)) 16px max(12px, var(--left)); background: #cfd0dc; }
.mobile .files { max-width: 720px; margin: auto; background: none; }
.mobile .project { margin-bottom: 12px; padding: 16px 14px 14px; border: 1px solid #9293aa; border-radius: 6px; background: #fff; }
.mobile .project > svg { width: 34px; height: 34px; }
.mobile .project h3 { font-size: 17px; line-height: 1.3; }
.mobile .project .kind, .mobile .project .tech { font-size: 13px; }
.mobile .actions a { flex: 1 1 110px; min-height: 46px; display: flex; align-items: center; justify-content: center; }

/* Music */
.mobile .player { padding: 0 max(8px, var(--right)) 8px max(8px, var(--left)); }
.mobile .amp-title { margin-inline: calc(-1 * max(8px, var(--right))) calc(-1 * max(8px, var(--left))); }
.mobile .amp-lcd { width: 150px; padding-inline: 6px; }
.mobile .amp-time { font-size: 24px; }
.mobile .amp-vis { width: 136px; height: 29px; }
.mobile .amp-seek { height: 30px; }
.mobile .amp-controls button { flex: 1 1 0; height: 44px; }
.mobile .amp-controls svg { width: 20px; height: 15px; }
.mobile .amp-volume { display: none; } /* phones use their own volume buttons */
.mobile .mixes { font-size: 15px; }
.mobile .mixes a {
  min-height: 56px; flex-direction: column; justify-content: center; gap: 1px;
  padding: 7px max(16px, var(--right)) 7px max(16px, var(--left));
}
.mobile .mixes small { max-width: none; text-align: left; font-size: 13px; }
.mobile .mixes a:not([aria-current]):hover, .mobile .mixes a:not([aria-current]):hover small { background: none; }
.mobile .copyright { margin: 0; padding: 14px max(16px, var(--right)) 18px max(16px, var(--left)); text-align: center; }

/* Résumé */
.mobile .window > iframe { flex: 1 1 0; padding-left: var(--left); padding-right: var(--right); }

/* About */
.mobile .properties { background: #fff; }
.mobile .sheet { padding: 0; border: 0; background: none; }
.mobile .sheet dl { width: 100%; padding: 12px; background: #f0f1f6; border: 1px solid #c5c6d3; }

/* Contact */
.mobile .compose-tools { padding: 4px max(8px, var(--right)) 4px max(8px, var(--left)); }
.mobile .compose .send { flex-direction: row; gap: 8px; min-height: 44px; padding: 0 16px; font-size: 16px; border-color: #9293aa; background: var(--silver-button); }
.mobile .compose-fields { padding: 10px max(12px, var(--right)) 10px max(12px, var(--left)); gap: 8px 10px; }
.mobile .compose-label { font-size: 15px; }
.mobile .compose-to, .mobile .compose input { min-height: 44px; display: flex; align-items: center; padding: 0 8px; font-size: 16px; }
.mobile .compose textarea { min-height: 180px; padding: 10px max(12px, var(--right)) 10px max(12px, var(--left)); font-size: 16px; }
.mobile .compose-status { padding: 10px max(12px, var(--right)) calc(10px) max(12px, var(--left)); font-size: 14px; }
.mobile .compose-status a { display: inline-block; min-height: 44px; padding: 12px 2px 0; }

/* Mini player */
.mobile .mini-player {
  position: fixed; left: 0; right: 0; bottom: var(--tabs); z-index: 100; height: 56px;
  display: flex; align-items: center;
  padding: 0 max(6px, var(--right)) 0 max(6px, var(--left));
  color: #a9f58b; background: linear-gradient(100deg, #174a7c, #05070c 75%); border-top: 2px solid #62637a;
}
.mobile[data-screen='music'] .mini-player { display: none; }
.mobile .mini-player a {
  flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; gap: 10px; padding: 0 6px;
  color: inherit; text-decoration: none; font-size: 14px;
}
.mini-player svg { width: 30px; height: 30px; }
.mini-player span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mini-player button {
  position: relative; flex: none; width: 44px; height: 44px; padding: 0;
  border: 1px solid #fff; border-radius: 50%; background: linear-gradient(145deg, #fff, #9495ad);
}
.mini-player button::before {
  content: ''; position: absolute; box-sizing: border-box; left: 15px; top: 13px; width: 12px; height: 16px;
  border: solid #22233a; border-width: 0 4px;
}
.mini-player button.paused::before {
  left: 17px; top: 12px; width: 0; height: 0;
  border-width: 9px 0 9px 14px; border-color: transparent transparent transparent #22233a;
}
.mini-player :focus-visible { outline-color: #fff; }

/* Tabs */
.mobile .tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; height: var(--tabs);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 0 var(--right) var(--bottom) var(--left);
  background: linear-gradient(#8d8ea5 0, #fff 6%, #d5d6e4 22%, #bcbdd0 65%, #c9cada 100%);
}
.mobile .tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 0; color: var(--ink); text-decoration: none; font-size: 11.5px;
}
.tabbar svg { width: 28px; height: 28px; }
.mobile .tabbar a[aria-current] {
  font-weight: 700;
  background: linear-gradient(#e8962e 0, #e8962e 3px, #a6a8bf 3px, #c3c5d6 100%);
}

/* Landscape phones: tabs move to the side so content keeps its height. */
@media (max-height: 500px) and (min-width: 500px) {
  .mobile { --rail: calc(88px + var(--left)); }
  .mobile #desktop { left: var(--rail); bottom: var(--mini); }
  .mobile .tabbar {
    top: 0; right: auto; width: var(--rail); height: auto;
    grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(5, minmax(0, 1fr));
    padding: var(--top) 0 var(--bottom) var(--left);
    border-right: 1px solid #73748c;
  }
  .mobile .tabbar svg { width: 24px; height: 24px; }
  .mobile .mini-player { left: var(--rail); bottom: 0; }
  .mobile .bar { height: calc(46px + var(--top)); }
  .mobile .bar .back { bottom: 1px; }
  .mobile .amp-title, .mobile .amp-tags { display: none; }
  .mobile .today { min-height: 90px; padding-block: 10px; }
  .mobile .today strong { font-size: 38px; }
}

/* Tablets */
@media (min-width: 700px) and (min-height: 501px) {
  .mobile .today { min-height: 280px; }
  .mobile .today strong { font-size: 76px; }
  .mobile .menu { display: grid; grid-template-columns: 1fr 1fr; }
  .mobile .menu li:last-child { grid-column: 1 / -1; }
  .mobile .menu a { min-height: 92px; }
  .mobile .socials { grid-template-columns: repeat(4, 1fr); }
  .mobile .properties > *, .mobile .compose > * { max-width: 680px; margin-left: auto; margin-right: auto; }
}
