/* foodmasku — iPhone SE shell */
:root {
  --screen-w: 375px;
  --screen-h: 667px;
  --frame: #111;
  --ios-bg: #f2f2f7;
  --ios-text: #000;
  --ios-sub: #8e8e93;
  --ios-blue: #007aff;
  --radius-icon: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: #222;
  display: grid;
  place-items: center;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button { font: inherit; border: 0; background: none; cursor: pointer; color: inherit; }

/* Desktop scene (rotating backgrounds in v0.2) */
.scene {
  position: fixed; inset: 0;
  background: radial-gradient(circle at 30% 30%, #f7c9a9, #c96b5c 60%, #5b2a2a);
}
.scene-layer {
  position: absolute; inset: 0; opacity: 0;
  background: center / cover no-repeat; transition: opacity 1.5s ease;
}
.scene-layer.on { opacity: 1; }

/* Phone frame */
.phone {
  position: relative;
  width: calc(var(--screen-w) + 28px);
  background: var(--frame);
  border-radius: 54px;
  padding: 0 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5), inset 0 0 0 2px #333;
  transform-origin: center;
}
.bezel-top, .bezel-bottom { height: 96px; display: flex; align-items: center; justify-content: center; position: relative; }
.camera { width: 10px; height: 10px; border-radius: 50%; background: #2a2a2a; position: absolute; left: 34%; }
.speaker { width: 50px; height: 6px; border-radius: 3px; background: #2a2a2a; }
.home-button {
  width: 58px; height: 58px; border-radius: 50%;
  border: 2px solid #333; background: #0c0c0c;
}
.home-button:focus-visible { outline: 2px solid var(--ios-blue); outline-offset: 3px; }

.screen {
  position: relative;
  width: var(--screen-w); height: var(--screen-h);
  background-color: #ff0844;
  background-image: linear-gradient(160deg, #ffb199, #ff0844);
  background-size: cover; background-position: center;
  overflow: hidden;
}

/* Status bar */
.statusbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  height: 20px; padding: 0 6px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  font-size: 14px; font-weight: 400; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.sb-left { justify-self: start; }
.sb-time { justify-self: center; font-weight: 400; }
.sb-right { justify-self: end; display: flex; align-items: center; gap: 4px; }
.batt-pct { color: #ff3b30; font-weight: 400; }
.batt {
  position: relative; width: 24px; height: 11px; border-radius: 3px;
  border: 1px solid currentColor; opacity: .9; padding: 1px;
}
.batt::after { content: ""; position: absolute; right: -3px; top: 3px; width: 2px; height: 4px; border-radius: 0 1px 1px 0; background: currentColor; }
.batt-fill { display: block; height: 100%; width: 17%; border-radius: 1px; background: #ff3b30; }
.screen.app-open .statusbar { color: #000; text-shadow: none; }

/* Home screen */
.home { position: absolute; inset: 20px 0 0; display: flex; flex-direction: column; }
.grid {
  flex: 1;
  display: grid; grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 92px; gap: 4px 0;
  padding: 16px 12px 0; align-content: start;
}
.icon { text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 5px; color: #fff; font-size: 16px; font-weight: 500; letter-spacing: -.01em; text-shadow: 0 1px 3px rgba(0,0,0,.45); }
.icon-img {
  width: 60px; height: 60px; border-radius: var(--radius-icon);
  display: grid; place-items: center; font-size: 28px;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.icon:active .icon-img { filter: brightness(.8); }
.icon:focus-visible .icon-img { outline: 3px solid #fff; outline-offset: 2px; }
.dock {
  height: 92px; margin: 0 0 0;
  background: rgba(255,255,255,.3); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; padding: 0 12px;
}
.dock { height: 104px; display: flex; justify-content: center; gap: 28px; }
.dock .icon { width: 64px; }

/* App view */
.app {
  position: absolute; inset: 0; z-index: 4;
  background: var(--ios-bg); color: var(--ios-text);
  display: flex; flex-direction: column; padding-top: 20px;
  animation: appOpen .28s cubic-bezier(.2,.8,.2,1);
}
.app.closing { animation: appClose .22s ease-in forwards; }
@keyframes appOpen { from { transform: scale(.2); opacity: 0; border-radius: 40px; } to { transform: none; opacity: 1; } }
@keyframes appClose { to { transform: scale(.2); opacity: 0; } }
.app-header {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: 44px; padding: 0 8px; background: rgba(249,249,249,.94);
  border-bottom: .5px solid #c6c6c8;
}
.app-back { color: var(--ios-blue); justify-self: start; font-size: 19px; }
.app-title { font-size: 20px; font-weight: 600; }
.app-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* Shared list styles */
.list { background: #fff; margin: 16px; border-radius: 10px; overflow: hidden; }
.list a, .list .row { display: flex; justify-content: space-between; padding: 12px 16px; color: inherit; text-decoration: none; border-bottom: .5px solid #e5e5ea; font-size: 19px; }
.list a:last-child, .list .row:last-child { border-bottom: 0; }
.list a::after { content: "\203A"; color: #c7c7cc; }
.sub { color: var(--ios-sub); font-size: 16px; }
.empty { padding: 40px 24px; text-align: center; color: var(--ios-sub); }

/* Notes */
.app-body:has(.note) { background: #fff; }
.note { background: #fff; padding: 20px; font-size: 19px; line-height: 1.45; }
.note h2 { font-size: 29px; margin-bottom: 12px; }
.note p { margin-bottom: 12px; }

/* Instagram */
.ig-head { display: flex; gap: 16px; align-items: center; padding: 16px; background: #fff; }
.ig-avatar { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(45deg,#f9ce34,#ee2a7b,#6228d7); padding: 3px; }
.ig-avatar div { width: 100%; height: 100%; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 30px; }
.ig-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: #fff; }
.ig-grid button { aspect-ratio: 1; background: #ddd center/cover no-repeat; }
.ig-post { background: #fff; }
.ig-post img { width: 100%; display: block; }
.ig-post .cap { padding: 12px 16px; font-size: 17px; }
.ig-post a { display: block; padding: 0 16px 16px; color: var(--ios-blue); font-size: 17px; text-decoration: none; }

/* Photos */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.photo-grid button { display: block; padding: 0; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #ddd; }
.app-body:has(.photo-view) { background: #000; }
.photo-view { height: 100%; display: flex; flex-direction: column; background: #000; color: #fff; touch-action: pan-y; }
.photo-view img { flex: 1; width: 100%; object-fit: contain; min-height: 0; user-select: none; -webkit-user-drag: none; }
.pv-all { align-self: flex-start; color: var(--ios-blue); font-size: 19px; padding: 10px 12px; }
.pv-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; font-size: 16px; }
.pv-bar button { font-size: 32px; width: 44px; color: #fff; }
.pv-bar button:disabled { opacity: .25; }

/* Videos */
.video-card { background: #fff; margin-bottom: 8px; }
.video-card iframe, .video-card video, .video-card .ph { width: 100%; aspect-ratio: 16/9; border: 0; display: block; background: #000; }
.video-card video { aspect-ratio: auto; height: auto; max-height: 520px; object-fit: contain; }
.video-card .meta { padding: 10px 12px; font-size: 17px; font-weight: 600; }

/* Software Update */
.update { background: #fff; margin: 16px; border-radius: 10px; padding: 16px; }
.update h3 { font-size: 18px; }
.update ul { margin: 8px 0 0 18px; font-size: 17px; line-height: 1.5; }

/* Wallpaper fade-in: photo sits on a layer above the gradient and fades in once loaded */
.screen::before, .lock::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: var(--wall, none) center / cover no-repeat; opacity: 0; transition: opacity .6s ease;
}
.screen.wall-on::before, .lock.wall-on::before { opacity: 1; }
.lock > * { position: relative; z-index: 1; }

/* Lock screen */
.lock {
  position: absolute; inset: 0; z-index: 8;
  background-color: #ff0844;
  background-image: linear-gradient(160deg, #ffb199, #ff0844);
  background-size: cover; background-position: center;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 70px 0 28px; color: #fff; touch-action: none; user-select: none; -webkit-user-select: none;
  cursor: grab; will-change: transform;
}
.lock.dragging { cursor: grabbing; }
.lock.release { transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .35s; }
.lock.gone { transform: translateY(-100%); opacity: .6; }
.lock-clock { text-align: center; text-shadow: 0 1px 6px rgba(0,0,0,.2); }
.lock-time { font-size: 82px; font-weight: 200; line-height: 1; letter-spacing: -.02em; }
.lock-date { font-size: 23px; font-weight: 500; margin-top: 6px; }
.lock-hint { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #fff; font-size: 19px; font-weight: 500; }
.lock-chevron { font-size: 26px; line-height: 1; animation: nudge 1.6s ease-in-out infinite; }
.lock-text {
  background: linear-gradient(90deg, rgba(255,255,255,.55) 0%, #fff 50%, rgba(255,255,255,.55) 100%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 2.4s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes nudge { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.lock.bounce { animation: bounce .5s ease; }
@keyframes bounce { 0%,100% { transform: none; } 40% { transform: translateY(-40px); } }

/* Glass icons (all app icons share the see-through look) */
.glass {
  background: linear-gradient(145deg, rgba(255,255,255,.45), rgba(255,255,255,.15));
  backdrop-filter: blur(14px) saturate(1.6); -webkit-backdrop-filter: blur(14px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), inset 0 0 0 1px rgba(255,255,255,.25), 0 4px 12px rgba(0,0,0,.18);
}

/* Folder */
.folder-icon {
  display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 14px; gap: 3px; padding: 8px; align-content: start;
}
.mini { width: 14px; height: 14px; border-radius: 4px; display: grid; place-items: center; font-size: 8px; }
.folder {
  position: absolute; inset: 0; z-index: 7;
  background: rgba(0,0,0,.25); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  opacity: 0; transition: opacity .2s ease;
}
.folder.show { opacity: 1; }
.folder-name { color: #fff; font-size: 29px; font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,.3); }
.folder-box {
  width: 80%; padding: 18px 10px; border-radius: 28px;
  background: rgba(255,255,255,.35); display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 0;
  transform: scale(.85); transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.folder.show .folder-box { transform: none; }

/* Notification banner */
.banner {
  position: absolute; top: 8px; left: 8px; right: 8px; z-index: 10;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; text-align: left;
  background: rgba(245,245,245,.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.2); color: #000;
  transform: translateY(-140%); transition: transform .4s cubic-bezier(.2,.8,.2,1);
}
.banner.show { transform: none; }
.banner-icon { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; font-size: 18px; flex: none; }
.banner-text { flex: 1; display: flex; flex-direction: column; font-size: 16px; line-height: 1.3; }
.banner-time { font-size: 14px; color: var(--ios-sub); align-self: flex-start; }

/* Wallet */
.wallet { padding: 12px; background: #000; min-height: 100%; }
.pass {
  display: block; color: #fff; text-decoration: none; margin-bottom: 12px; padding: 14px 16px;
  border-radius: 12px; background: linear-gradient(135deg, #ff5e62, #ff9966);
}
.pass.type-solo { background: linear-gradient(135deg, #ff2d55, #ff9500); }
.pass.type-screens { background: linear-gradient(135deg, #5856d6, #af52de); }
.pass.type-talk { background: linear-gradient(135deg, #007aff, #5ac8fa); }
.pass.type-festival, .pass.type-fair { background: linear-gradient(135deg, #34c759, #30b0c7); }
.pass.type-performance, .pass.type-screening { background: linear-gradient(135deg, #ff9500, #ffcc00); color: #1c1c1e; }
.pass.expired { filter: saturate(.55) brightness(.8); }
.pass-row > div { flex: 1; }
.pass-top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; letter-spacing: .08em; opacity: .85; }
.pass-title { font-size: 26px; font-weight: 700; margin: 10px 0 12px; }
.pass-row { display: flex; gap: 24px; font-size: 17px; margin-top: 8px; }
.pass-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; opacity: .7; }
.wallet-h { color: #fff; font-size: 24px; margin: 20px 4px 10px; }
.app:has(.wallet) { background: #000; }
.app:has(.wallet) .app-header { background: #000; color: #fff; border-color: #222; }
.screen:has(.wallet) .statusbar, .screen:has(.camera-teaser) .statusbar { color: #fff; }

/* News */
.news { background: #fff; }
.news-h { font-size: 26px; font-weight: 800; padding: 16px 16px 4px; }
.story { display: flex; gap: 12px; padding: 14px 16px; border-bottom: .5px solid #e5e5ea; color: inherit; text-decoration: none; }
.story-text { flex: 1; }
.story-outlet { font-size: 14px; font-weight: 800; text-transform: uppercase; color: #e8202a; }
.story-title { font-size: 20px; font-weight: 700; line-height: 1.25; margin: 4px 0; }
.story img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; }

/* Messages */
.app-body:has(.thread) { display: flex; flex-direction: column; background: #fff; }
.thread { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 14px 12px; overflow-y: auto; }
.bubble { max-width: 75%; padding: 8px 12px; border-radius: 18px; font-size: 19px; line-height: 1.3; }
.bubble.them { background: #e9e9eb; align-self: flex-start; }
.bubble.me { background: var(--ios-blue); color: #fff; align-self: flex-end; }
.compose { display: flex; gap: 8px; padding: 8px 10px; border-top: .5px solid #e5e5ea; }
.compose input { flex: 1; border: 1px solid #d1d1d6; border-radius: 18px; padding: 7px 14px; font: inherit; font-size: 19px; }
.compose button { width: 32px; height: 32px; border-radius: 50%; background: var(--ios-blue); color: #fff; font-weight: 700; align-self: center; }

/* Safari */
.app-body:has(.safari) { overflow: hidden; }
.safari { height: 100%; display: flex; flex-direction: column; background: #f2f2f7; }
.safari-bar {
  display: flex; justify-content: center; gap: 8px; align-items: center;
  margin: 8px 10px; padding: 8px 12px; border-radius: 10px; background: #e3e3e8;
  font-size: 18px; color: #1c1c1e; text-decoration: none;
}
.safari-open { color: var(--ios-blue); font-weight: 600; }
.safari-frame { flex: 1; width: 100%; border: 0; background: #fff; }

/* Camera teaser */
.app:has(.camera-teaser) { background: #000; }
.app:has(.camera-teaser) .app-header { background: #000; color: #fff; border-color: #222; }
.camera-teaser { min-height: 100%; background: #000; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px; }
.camera-lens { width: 120px; height: 120px; border-radius: 50%; border: 4px solid #333; display: grid; place-items: center; font-size: 56px; margin-bottom: 10px; }
.camera-teaser p { color: #8e8e93; }

/* Real phone: drop the frame, go full screen */
body.native { background: #000; }
body.native .scene, body.native .bezel-top, body.native .bezel-bottom { display: none; }
body.native .phone { width: 100vw; height: 100dvh; border-radius: 0; padding: 0; box-shadow: none; background: transparent; }
body.native .screen { width: 100vw; height: 100dvh; }
body.native .statusbar { display: none; }
body.native .home { inset: env(safe-area-inset-top, 0) 0 0; }
body.native .app { padding-top: env(safe-area-inset-top, 0); }
body.native .dock { padding-bottom: env(safe-area-inset-bottom, 0); height: calc(104px + env(safe-area-inset-bottom, 0)); }

@media (prefers-reduced-motion: reduce) {
  .app, .app.closing { animation: none; }
  .scene-layer, .banner, .lock.release, .folder, .folder-box { transition: none; }
  .lock-chevron, .lock-text { animation: none; color: #fff; }
}
