/* ————————————————————————————————
   Logan Voss — iPhone Portfolio
———————————————————————————————— */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --ink: #1c1c1e;
  --ink-soft: rgba(28,28,30,.62);
  --red: #FA2D48;
  --spring: cubic-bezier(.34,1.45,.5,1);
  --ease-out: cubic-bezier(.22,.9,.3,1);
}

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #ffffff;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  color: var(--ink);
}

.stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: #ffffff;
}

/* ————— Phone + bezel (desktop) ————— */
.phone {
  position: relative;
  aspect-ratio: 501 / 1024;
  height: min(94vh, 140vw);
  height: min(94dvh, 140vw);
}

.bezel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  filter:
    drop-shadow(0 2.2vh 4.5vh rgba(25,15,60,.20))
    drop-shadow(0 .5vh 1.2vh rgba(25,15,60,.10));
}

.screen {
  position: absolute;
  left: 3.19%;
  top: 1.27%;
  width: 93.61%;
  height: 97.36%;
  z-index: 1;
  overflow: hidden;
  background: #dfe9fa;
  container-type: size;
  border-radius: 16.4% / 7.7%;
}

/* ————— Mobile: no phone frame; normal cover wallpaper ————— */
html.mobile,
html.mobile body {
  height: 100%;
  min-height: 100%;
  overflow: visible;
  background-color: #c8d9f6;
  background-image: url("assets/wallpaper-hd.jpg");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

html.mobile .bezel,
html.mobile .island { display: none; }

html.mobile .stage {
  display: block;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: transparent;
  overflow: visible;
}

html.mobile .phone {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
  background: transparent;
  overflow: visible;
  filter: none;
}

html.mobile .screen {
  position: absolute;
  inset: 0;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
}

html.mobile .wallpaper {
  display: block;
  position: absolute;
  inset: 0;
  background: url("assets/wallpaper-hd.jpg") center / cover no-repeat;
}

/* ————— Wallpaper (desktop, inside the bezel) ————— */
.wallpaper {
  position: absolute;
  inset: 0;
  background: url("assets/wallpaper-hd.jpg") center / cover no-repeat #dfe9fa;
}

/* ————— Dynamic Island ————— */
.island {
  position: absolute;
  top: 1.6cqh;
  left: 50%;
  transform: translateX(-50%);
  width: 27cqw;
  height: 3.6cqh;
  background: #000;
  border-radius: 10cqw;
  z-index: 40;
  pointer-events: none;
}

/* ————— Status bar ————— */
.statusbar {
  height: 6.9cqh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 9cqw 0 9cqw;
  position: relative;
  z-index: 5;
  flex: none;
}
.sb-left, .sb-right { display: flex; align-items: center; gap: 2.2cqw; }
.sb-time { font-size: 4.1cqw; font-weight: 600; letter-spacing: .02em; }
.carrier-name { font-size: 3.9cqw; font-weight: 500; }
.statusbar { color: #16233f; }
.sb-ic { width: 5.4cqw; height: 3.4cqw; fill: #16233f; }
.sb-ic.wifi { width: 4.6cqw; }
.sb-ic.batt { width: 6.6cqw; }
.sb-ic [stroke-width] { stroke: #16233f; }
.sb-ic path[stroke-width], .sb-ic rect[stroke-width] { stroke: #16233f; }

/* ————— Boot ————— */
.boot {
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 60;
  display: grid;
  place-items: center;
  opacity: 1;
  transition: opacity .55s ease;
}
.boot.done { opacity: 0; pointer-events: none; }
.boot-logo {
  width: 21cqw;
  height: 21cqw;
  fill: #fff;
  opacity: 0;
  animation: logoIn .8s ease .15s forwards;
}
@keyframes logoIn {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}
.boot-track {
  position: absolute;
  top: 63cqh;
  left: 50%;
  transform: translateX(-50%);
  width: 33cqw;
  height: .55cqh;
  min-height: 3px;
  border-radius: 1cqw;
  background: rgba(255,255,255,.22);
  overflow: hidden;
  opacity: 0;
  animation: trackIn .4s ease .7s forwards;
}
@keyframes trackIn { to { opacity: 1; } }
.boot-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: #fff;
  animation: fillBoot 2.25s cubic-bezier(.45,.08,.35,1) .78s forwards;
}
@keyframes fillBoot {
  0%   { width: 0%; }
  42%  { width: 57%; }
  100% { width: 100%; }
}

/* ————— Lock screen ————— */
.lock {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  touch-action: none;
  transition: transform .55s cubic-bezier(.3,.8,.3,1), opacity .5s ease, filter .55s ease;
  will-change: transform;
}
.lock.away {
  transform: translateY(-106%) scale(.985);
  opacity: 0;
  filter: blur(10px);
  pointer-events: none;
}
.lock.hidden { display: none; }
.lock.dragging { transition: none; }

.lock-top { text-align: center; margin-top: 5.2cqh; }
.lock-date {
  font-size: 5.35cqw;
  font-weight: 650;
  color: #16233f;
  letter-spacing: -.015em;
  text-shadow: 0 1px 0 rgba(255,255,255,.52), 0 .45cqh 1.5cqh rgba(73,91,139,.16);
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity .7s ease .1s, transform .7s var(--ease-out) .1s;
}
.lock-time {
  font-size: 21.5cqw;
  font-weight: 720;
  color: #16233f;
  letter-spacing: -.045em;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255,255,255,.56), 0 .6cqh 2cqh rgba(73,91,139,.2);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transform: translateY(-14px);
  transition: opacity .8s ease .22s, transform .8s var(--ease-out) .22s;
}
.lock.show .lock-date, .lock.show .lock-time { opacity: 1; transform: none; }

/* notifications */
.notifications {
  margin-top: 4.5cqh;
  padding: 0 3.6cqw;
  display: flex;
  flex-direction: column;
  gap: 2cqh;
}
.notif {
  display: flex;
  align-items: center;
  gap: 3.2cqw;
  width: 100%;
  text-align: left;
  border: 0;
  cursor: pointer;
  padding: 3cqw 3.6cqw;
  border-radius: 5.2cqw;
  background: rgba(255,255,255,.52);
  -webkit-backdrop-filter: blur(22px) saturate(1.7);
  backdrop-filter: blur(22px) saturate(1.7);
  box-shadow: 0 1.2cqh 3cqh rgba(40,30,90,.14);
  color: var(--ink);
  font: inherit;
  opacity: 0;
  transform: translateY(-26px) scale(.94);
  filter: blur(8px);
}
.notif.in {
  opacity: 1;
  transform: none;
  filter: blur(0);
  transition: opacity .55s ease, transform .65s var(--spring), filter .55s ease;
}
.notif:active { transform: scale(.97); }
.notif.in:active { transform: scale(.97); transition: transform .15s ease; }
.notif-icon { width: 9.5cqw; height: 9.5cqw; flex: none; border-radius: 22.5%; overflow: hidden; display: block; }
.notif-icon svg, .notif-icon img { width: 100%; height: 100%; display: block; }
.notif-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.notif-top { display: flex; justify-content: space-between; align-items: baseline; }
.notif-app { font-size: 3.1cqw; font-weight: 500; letter-spacing: .04em; color: var(--ink-soft); }
.notif-when { font-size: 3.1cqw; color: var(--ink-soft); }
.notif-title { font-size: 3.9cqw; font-weight: 700; margin-top: .2cqh; }
.notif-text { font-size: 3.9cqw; font-weight: 400; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* mini calendar icon inside notification */
.cal-mini {
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.cal-mini-dow { font-size: 2.1cqw; font-weight: 600; color: var(--red); letter-spacing: .06em; line-height: 1; }
.cal-mini-day { font-size: 5.4cqw; font-weight: 500; color: var(--ink); line-height: 1.05; }

/* lock bottom buttons */
.lock-bottom {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  padding: 0 9cqw;
}
.lock-round {
  width: 12.5cqw;
  height: 12.5cqw;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: rgba(10,10,20,.38);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  display: grid;
  place-items: center;
  transition: transform .18s var(--spring), background .25s ease;
}
.lock-round svg { width: 62%; height: 62%; }
.lock-round:active { transform: scale(.88); }
.lock-round.on { background: rgba(255,255,255,.92); }
.lock-round.on svg use { filter: brightness(0); }

/* flashlight beam overlay */
.flash-overlay {
  position: absolute;
  inset: 0;
  z-index: 35;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.flash-overlay.on { opacity: .96; }

.swipe-zone { text-align: center; padding-bottom: 1.2cqh; margin-top: 2.5cqh; }
.swipe-hint {
  font-size: 3.7cqw;
  font-weight: 600;
  color: #16233f;
  opacity: .75;
  margin-bottom: 1.6cqh;
  animation: hintPulse 2.6s ease-in-out infinite;
}
@keyframes hintPulse { 0%,100% { opacity: .45; } 50% { opacity: .85; } }

.home-indicator {
  width: 34cqw;
  height: .62cqh;
  min-height: 3px;
  border-radius: 1cqw;
  background: #16233f;
  margin: 0 auto;
}

/* ————— Home screen ————— */
.home {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  visibility: hidden;
}
.home.unlocked { visibility: visible; }

.pages { flex: 1; overflow: hidden; touch-action: none; }
.pages-track {
  display: flex;
  height: 100%;
  transition: transform .5s cubic-bezier(.32,.72,.33,1);
  will-change: transform;
}
.pages-track.dragging { transition: none; }

.page {
  flex: 0 0 100%;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 15.3cqw);
  grid-auto-rows: 10.9cqh;
  grid-auto-flow: dense;
  column-gap: 8.46cqw;
  row-gap: 1.7cqh;
  justify-content: center;
  align-content: start;
  padding-top: 1.2cqh;
}

/* app icons */
.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
  min-width: 0;
}
.app-icon {
  width: 15.3cqw;
  height: 15.3cqw;
  border-radius: 23%;
  overflow: hidden;
  display: block;
  box-shadow: 0 .9cqh 2.2cqh rgba(35,25,80,.13);
  transition: transform .18s var(--spring), filter .18s ease;
  will-change: transform;
}
.app-icon img, .app-icon svg { width: 100%; height: 100%; display: block; }
.app:active .app-icon { transform: scale(.84); filter: brightness(.82); }
.app-label {
  margin-top: .9cqh;
  font-size: 3.05cqw;
  font-weight: 500;
  line-height: 1.15;
  max-width: 19cqw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #16233f;
}

/* entrance animation */
.home .app, .home .widget, .home .dock, .home .statusbar, .home .dots {
  opacity: 0;
}
.home.unlocked .statusbar { opacity: 1; transition: opacity .5s ease .25s; }
.home.unlocked .dots { opacity: 1; transition: opacity .5s ease .55s; }
.home.unlocked .dock {
  opacity: 1;
  transform: none;
  transition: opacity .55s ease .3s, transform .65s var(--spring) .3s;
}
.home .dock { transform: translateY(130%); }
.home.unlocked .app, .home.unlocked .widget {
  opacity: 1;
  transform: none;
  transition:
    opacity .5s ease var(--d, 0s),
    transform .62s var(--spring) var(--d, 0s);
}
.home .app, .home .widget { transform: scale(.3) translateY(26%); }

/* widgets */
.widget {
  border-radius: 5.4cqw;
  overflow: hidden;
  cursor: pointer;
  border: 0;
  text-align: left;
  font: inherit;
  color: var(--ink);
  box-shadow: 0 .9cqh 2.2cqh rgba(35,25,80,.13);
  transition: transform .18s var(--spring), filter .18s ease;
  display: block;
  text-decoration: none;
}
.widget:active { transform: scale(.95); filter: brightness(.94); }
.widget.w4 { grid-column: span 4; grid-row: span 2; }
.widget.w2 { grid-column: span 2; grid-row: span 2; }

/* calendar reminder widget (page 1) */
.wg-cal {
  position: relative;
  background: rgba(255,255,255,.62);
  -webkit-backdrop-filter: blur(22px) saturate(1.7);
  backdrop-filter: blur(22px) saturate(1.7);
  display: flex;
  align-items: center;
  padding: 0 5.5cqw;
  gap: 5cqw;
  cursor: pointer;
}
.wg-cal-badge {
  flex: none;
  width: 15.5cqw;
  aspect-ratio: 1;
  background: #fff;
  border-radius: 3.6cqw;
  box-shadow: 0 .5cqh 1.4cqh rgba(35,25,80,.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.wg-cal-badge-mon { font-size: 3.3cqw; font-weight: 700; color: var(--red); letter-spacing: .07em; line-height: 1; }
.wg-cal-badge-day { font-size: 8.8cqw; font-weight: 500; color: var(--ink); line-height: 1.04; }
.wg-cal-right { min-width: 0; padding-right: 13cqw; }
.wg-cal-kicker { font-size: 3.5cqw; font-weight: 600; color: var(--red); letter-spacing: .05em; text-transform: uppercase; }
.wg-cal-name { font-size: 5.4cqw; font-weight: 700; margin-top: .5cqh; letter-spacing: -.01em; }
.wg-cal-meta { display: block; font-size: 3.8cqw; line-height: 1.3; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-cal-name + .wg-cal-meta { margin-top: .5cqh; }
.wg-cal-pill {
  position: absolute;
  top: 1.9cqh;
  right: 4.2cqw;
  font-size: 3.3cqw;
  font-weight: 600;
  color: var(--red);
  background: rgba(250,45,72,.12);
  padding: .6cqh 2.8cqw;
  border-radius: 3cqw;
}

/* square album-art music widget (page 2) */
.wg-music {
  position: relative;
  align-self: start;
  aspect-ratio: 1;
  height: auto;
  background: #5f8f9e;
  color: #fff;
  padding: 0;
}
.wg-m-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.wg-m-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10,24,42,.03) 35%, rgba(7,20,38,.76) 100%);
}
.wg-m-copy {
  position: absolute;
  left: 3.4cqw;
  right: 3.4cqw;
  bottom: 2.6cqw;
  display: flex;
  flex-direction: column;
  text-shadow: 0 1px 5px rgba(0,0,0,.42);
}
.wg-music .wg-m-label { font-size: 2.45cqw; font-weight: 650; letter-spacing: .07em; opacity: .88; text-transform: uppercase; }
.wg-music .wg-m-name { font-size: 4.25cqw; font-weight: 750; line-height: 1.08; margin-top: .3cqh; }
.wg-music .wg-m-sub { font-size: 2.9cqw; font-weight: 550; opacity: .9; margin-top: .15cqh; }

/* page dots */
.dots {
  flex: none;
  display: flex;
  justify-content: center;
  gap: 2.4cqw;
  padding: 1cqh 0 1.4cqh;
}
.dot {
  width: 1.9cqw;
  height: 1.9cqw;
  border-radius: 50%;
  background: rgba(22,35,63,.28);
  border: 0;
  cursor: pointer;
  padding: 0;
  transition: background .3s ease, transform .3s ease;
}
.dot.active { background: #16233f; transform: scale(1.12); }

/* dock */
.dock {
  flex: none;
  margin: 0 3.6cqw 1.4cqh;
  padding: 1.5cqh 2cqw 1.3cqh;
  border-radius: 6.8cqw;
  background: rgba(255,255,255,.30);
  -webkit-backdrop-filter: blur(26px) saturate(1.8);
  backdrop-filter: blur(26px) saturate(1.8);
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  box-shadow: 0 .9cqh 2.6cqh rgba(10,8,30,.18);
}
.dock .app-icon { box-shadow: none; width: 14.2cqw; height: 14.2cqw; }
.dock .app-label { font-size: 2.85cqw; margin-top: .5cqh; }
.home > .home-indicator { margin-bottom: 1.1cqh; flex: none; }

/* ————— Mobile tweaks ————— */
html.mobile .statusbar { display: none; }
html.mobile .home {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html.mobile .lock { padding-top: calc(env(safe-area-inset-top, 0px) + 1.5cqh); }
html.mobile .lock-top { margin-top: 4.5cqh; }
html.mobile .home > .home-indicator,
html.mobile .swipe-zone .home-indicator { display: none; }
html.mobile .swipe-zone { padding-bottom: calc(1cqh + env(safe-area-inset-bottom, 0px)); }

/* desktop cursor */
body:not(.mobile) .app:hover .app-icon { transform: scale(1.04); }
body:not(.mobile) .app:active .app-icon { transform: scale(.84); }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .15s !important; }
}
