/* ==========================================================================
   Phone UI — Windows Phone 8.1 style (lock screen, live tiles, pivots)
   ========================================================================== */
body.phone {
  --acc: #1ba1e2;
  --u: calc((min(100vw, 520px) - 24px - 3 * 6px) / 4);   /* one small-tile unit */
  overflow-x: hidden; overflow-y: auto; background: #000; color: #fff;
  font-family: "Segoe UI", "Selawik", system-ui, sans-serif; font-weight: 400; -webkit-text-size-adjust: 100%;
}
body.phone a { color: var(--acc); }
.wp { max-width: 520px; margin: 0 auto; min-height: 100vh; }
.wp-sbar { display: flex; justify-content: space-between; align-items: center; height: 26px; padding: 0 12px; font-size: 13px; color: #fff; }
.sig { display: inline-block; width: 18px; height: 11px; background: linear-gradient(90deg, #fff 0 3px, transparent 3px 5px, #fff 5px 8px, transparent 8px 10px, #fff 10px 13px, transparent 13px 15px, rgba(255,255,255,.4) 15px 18px); clip-path: polygon(0 100%, 100% 0, 100% 100%); }

/* ---------- Start ---------- */
.wp-start { padding: 0 12px 28px; }
.wp-tiles { display: grid; grid-template-columns: repeat(4, var(--u)); grid-auto-rows: var(--u); gap: 6px; grid-auto-flow: dense; margin-top: 18px; }
.tile {
  position: relative; overflow: hidden; background: var(--acc); color: #fff !important; text-decoration: none !important;
  transform-origin: 50% 50%; transition: transform .1s; -webkit-tap-highlight-color: transparent; outline: none;
}
.tile:focus-visible { box-shadow: inset 0 0 0 3px #fff; }
.t-small { grid-column: span 1; grid-row: span 1; }
.t-med { grid-column: span 2; grid-row: span 2; }
.t-wide { grid-column: span 4; grid-row: span 2; }
.t-label { position: absolute; left: 8px; bottom: 6px; font-size: 14px; font-weight: 400; text-transform: lowercase; text-shadow: 0 1px 2px rgba(0,0,0,.25); z-index: 2; }
.t-faces { position: absolute; inset: 0; perspective: 600px; }
.t-face { position: absolute; inset: 0; opacity: 0; transform: rotateX(-90deg); transform-origin: 50% 0; transition: transform .55s cubic-bezier(.2,.8,.3,1), opacity .2s; backface-visibility: hidden; }
.t-face.on { opacity: 1; transform: none; }
.t-face.out { opacity: 0; transform: rotateX(90deg); transform-origin: 50% 100%; transition: transform .45s ease-in, opacity .45s ease-in; }
.tf-ico { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.t-ico { width: 52%; height: 52%; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0,0,0,.35)); }
.t-small .t-ico { width: 64%; height: 64%; }
.t-count { position: absolute; right: 10px; bottom: 4px; font-size: 34px; font-weight: 300; }
.tf-text { position: absolute; inset: 10px 10px 28px; display: flex; flex-direction: column; justify-content: flex-start; }
.tf-text b { font-size: 18px; font-weight: 400; line-height: 1.2; margin-bottom: 4px; }
.tf-text span { font-size: 14px; line-height: 1.3; opacity: .92; }
.tf-big { position: absolute; inset: 10px 12px 28px; display: flex; flex-direction: column; justify-content: center; }
.tf-big b { font-size: 34px; font-weight: 300; line-height: 1; margin-bottom: 6px; }
.tf-big span { font-size: 14px; line-height: 1.3; }
.tf-photo { position: absolute; inset: 0; display: flex; }
.tf-photo img { width: 50%; height: 100%; object-fit: cover; }
.tf-photo div { flex: 1; padding: 10px; display: flex; flex-direction: column; justify-content: flex-start; }
.tf-photo b { font-size: 20px; font-weight: 300; line-height: 1.15; }
.tf-photo span { font-size: 13px; opacity: .9; margin-top: 4px; }
.wp-arrow { display: block; margin: 18px 0 0 auto; width: 44px; height: 44px; border: 2px solid #fff; border-radius: 50%; background: none; color: #fff; font-size: 20px; line-height: 38px; padding: 0; }

/* turnstile */
.turn-in { animation: turnIn .38s cubic-bezier(.1,.9,.2,1); transform-origin: 0 50%; }
@keyframes turnIn { from { opacity: 0; transform: perspective(900px) rotateY(-70deg); } }
.tile.turn-out { animation: turnOut .26s cubic-bezier(.6,0,.9,.4) forwards; transform-origin: 0 50%; }
@keyframes turnOut { to { opacity: 0; transform: perspective(900px) rotateY(80deg); } }

/* ---------- All apps ---------- */
.wp-apps { padding: 0 12px 30px; }
.al-letter { width: 44px; height: 44px; margin: 14px 0 6px; padding: 0 0 4px 6px; display: flex; align-items: flex-end; border: 2px solid var(--acc); color: var(--acc); font-size: 26px; font-weight: 300; }
.al-row { display: flex; align-items: center; gap: 12px; padding: 5px 0; color: #fff !important; font-size: 20px; font-weight: 300; text-decoration: none !important; text-transform: lowercase; }
.al-ic { width: 44px; height: 44px; flex: none; background: var(--acc); display: flex; align-items: center; justify-content: center; }
.al-ic img { width: 30px; height: 30px; }

/* ---------- App + pivot ---------- */
.wp-app { padding: 0 0 80px; }
.pv-app { padding: 14px 16px 0; font-size: 14px; font-weight: 600; letter-spacing: .02em; }
.pv-heads { display: flex; gap: 22px; padding: 0 16px; margin: 2px 0 12px; overflow: hidden; white-space: nowrap; }
.pv-h { background: none; border: 0; padding: 0; color: rgba(255,255,255,.4); font: 300 44px/1.15 "Segoe UI", "Selawik", system-ui, sans-serif; letter-spacing: -.01em; text-transform: lowercase; flex: none; }
.pv-h.on { color: #fff; }
.pv-track { padding: 0 16px; min-height: 60vh; touch-action: pan-y; }
.pv-item { display: none; }
.pv-item.on { display: block; }
.pv-item.in-r { animation: pvR .32s cubic-bezier(.1,.9,.2,1); }
.pv-item.in-l { animation: pvL .32s cubic-bezier(.1,.9,.2,1); }
@keyframes pvR { from { opacity: 0; transform: translateX(60px); } }
@keyframes pvL { from { opacity: 0; transform: translateX(-60px); } }
.pv-item { font-size: 16px; line-height: 1.5; }
.pv-item h3 { font-size: 24px; font-weight: 300; margin: 20px 0 8px; text-transform: lowercase; }
.wp-dim { color: #9a9a9a; }
.wp-acc { color: var(--acc); }
.wp-lead { font-size: 20px; font-weight: 300; line-height: 1.35; margin: 12px 0; }
.wp-l1 { font-size: 22px; font-weight: 300; line-height: 1.2; }
.wp-hero { display: flex; gap: 14px; align-items: center; }
.wp-hero img { width: 96px; height: 96px; object-fit: cover; flex: none; }
.wp-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 14px 0; }
.wp-metrics div { background: var(--acc); padding: 10px; min-height: 84px; }
.wp-metrics b { display: block; font-size: 28px; font-weight: 300; line-height: 1.1; }
.wp-metrics span { font-size: 13px; opacity: .95; }
.wp-hl { display: block; padding: 12px 0; border-bottom: 1px solid #222; color: #fff !important; text-decoration: none !important; }
.wp-hl b { display: block; font-size: 30px; font-weight: 300; color: var(--acc); line-height: 1.1; }
.wp-hl span { font-size: 16px; color: #ddd; }
.wp-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.wp-pills span { padding: 4px 10px; border: 1px solid #444; font-size: 14px; color: #eee; }
.wp-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; color: #fff !important; text-decoration: none !important; }
.wp-item > div, .wp-item { flex-direction: row; }
.wp-item b { display: block; font-size: 20px; font-weight: 300; }
.wp-item span { display: block; font-size: 14px; color: #9a9a9a; }
.wp-item > b + span { margin-top: 2px; }
.wp-item:not(.link) { flex-direction: column; gap: 0; }
.wp-item img { width: 44px; height: 44px; flex: none; padding: 6px; background: var(--acc); }
.wp-role { font-size: 28px; font-weight: 300; line-height: 1.15; }
.wp-impact { font-size: 18px; font-weight: 300; line-height: 1.4; margin: 14px 0; padding-left: 12px; border-left: 3px solid var(--acc); }
.wp-ul { padding-left: 18px; } .wp-ul li { margin-bottom: 10px; }
.wp-certs { display: flex; flex-direction: column; }
.wp-cert { display: flex; gap: 12px; align-items: center; padding: 8px 0; }
.wp-cert img { width: 52px; height: 52px; flex: none; padding: 6px; background: var(--acc); }
.wp-cert b { display: block; font-size: 22px; font-weight: 300; }
.wp-cert span { display: block; font-size: 14px; color: #9a9a9a; }
.wp-cert a { font-size: 14px; }
.wp-btn { display: block; width: 100%; margin: 12px 0; padding: 9px 12px; border: 2px solid #fff; background: none; color: #fff; font: 400 17px "Segoe UI", "Selawik", system-ui, sans-serif; text-align: center; }
.wp-btn:active { background: var(--acc); border-color: var(--acc); }
.wp-form label { display: block; margin-bottom: 10px; color: #9a9a9a; font-size: 14px; }
.wp-form input, .wp-form select, .wp-form textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 2px solid #bbb; border-radius: 0; background: #ddd; color: #000; font: 400 17px "Segoe UI", "Selawik", system-ui, sans-serif; }
.wp-form input:focus, .wp-form select:focus, .wp-form textarea:focus { background: #fff; border-color: var(--acc); outline: none; }
.wp-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.wp-status { color: #ff5b5b; min-height: 20px; }
.wp-resume { background: #fff; color: #111; padding: 18px 14px; font-size: 13px; }
.wp-post { padding: 12px 0; border-bottom: 1px solid #222; }
.wp-more { background: none; border: 0; padding: 4px 0; color: var(--acc); font: inherit; }
.wp-pbody pre { background: #111; padding: 10px; overflow: auto; font-size: 13px; }
.wp-pbody code { font-family: Consolas, monospace; }
.wp-accents { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.wp-sw { aspect-ratio: 1; border: 0; position: relative; padding: 0; }
.wp-sw span { position: absolute; left: 4px; bottom: 2px; font-size: 11px; color: #fff; }
.wp-sw.on { box-shadow: inset 0 0 0 3px #fff; }

/* app bar */
.appbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; justify-content: center; gap: 28px; padding: 8px 16px 6px; background: #1f1f1f; }
.ab-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; color: #fff; padding: 0; }
.ab-c { width: 44px; height: 44px; border: 2px solid #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.ab-c img { width: 24px; height: 24px; }
.ab-l { font-size: 12px; height: 0; overflow: hidden; transition: height .15s; }
.appbar.open .ab-l { height: 16px; }
.ab-more { position: absolute; right: 10px; top: 4px; background: none; border: 0; color: #fff; font-size: 12px; letter-spacing: 2px; padding: 4px; }

/* lock screen */
.wp-lockscreen {
  position: fixed; inset: 0; z-index: 50; color: #fff; outline: none; touch-action: none; user-select: none;
  background: #0f3f56 url("../assets/wallpapers/aurora.webp") 30% center / cover no-repeat;
  transition: transform .38s cubic-bezier(.6,0,.4,1);
}
.wp-lockscreen::before { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.15), rgba(0,0,0,.05) 40%, rgba(0,0,0,.45)); }
.wp-lockscreen > * { position: relative; }
.wp-lockscreen.up { transform: translateY(-100%); }
.ls-top { height: 26px; padding: 0 12px; display: flex; align-items: center; }
.ls-main { position: absolute; left: 22px; right: 22px; bottom: 90px; }
.ls-time { font-size: 92px; font-weight: 300; line-height: 1; letter-spacing: -.02em; }
.ls-date { font-size: 26px; font-weight: 300; margin-top: 2px; }
.ls-notes { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; }
.ls-notes div { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.ls-notes img { width: 22px; height: 22px; }
.ls-hint { position: absolute; left: 0; right: 0; bottom: 26px; text-align: center; font-size: 13px; opacity: .8; animation: lsHint 2.4s ease-in-out infinite; }
@keyframes lsHint { 50% { transform: translateY(-6px); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .turn-in, .tile.turn-out, .pv-item.in-r, .pv-item.in-l, .ls-hint { animation: none !important; }
  .t-face { transition: none; }
}
.t-label.r { left: auto; right: 8px; }
