/* After hours: the lamp over the AI chapter with dust in its light, and the
   small visuals of the details bento (afterhours.js). */

/* ── the lamp ── */
/* --lamp-x places the lamp; afterhours.js reads it to aim the dust. */
.ai { overflow: hidden; --lamp-x: 78%; }
.ai > .wrap { position: relative; z-index: 1; }
.lamp { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.lamp-cord { position: absolute; left: var(--lamp-x); top: 0; width: 1.5px; height: 92px; background: rgba(230,224,217,.3); }
.lamp-shade {
  position: absolute; left: var(--lamp-x); top: 92px; width: 116px; height: 50px; margin-left: -58px;
  border-radius: 58px 58px 8px 8px; background: #2A3A43;
  box-shadow: inset 0 -2px 0 rgba(244,229,218,.25);
}
.lamp-shade::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; width: 34px; height: 14px; margin-left: -17px;
  border-radius: 50%; background: #F4E5DA; box-shadow: 0 0 22px 8px rgba(244,229,218,.35);
}
.lamp-cone {
  position: absolute; left: var(--lamp-x); top: 146px; width: 880px; height: 900px; margin-left: -440px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: radial-gradient(70% 90% at 50% 0%, rgba(244,229,218,.11), rgba(244,229,218,0) 75%);
}
.lamp .dust { position: absolute; inset: 0; width: 100%; height: 100%; }
html:not(.motion) .lamp .dust, html.reduced .lamp .dust { display: none; }

/* ── details: the bento visuals ── */
.tile-visual { display: flex; align-items: center; justify-content: center; }

/* 1 · phone and laptop, in step */
[data-tile="sync"] .tile-visual { gap: 0; justify-content: space-between; padding: 0 4%; }
.tv-laptop { width: 56%; display: flex; flex-direction: column; align-items: center; }
.tv-screen { width: 100%; height: 118px; display: flex; align-items: center; padding: 0 12px; border-radius: 10px 10px 4px 4px; border: 1.5px solid var(--line); background: var(--ground); }
.tv-base { width: 112%; height: 8px; border-radius: 0 0 8px 8px; background: var(--line); }
.tv-phone { width: 21%; height: 150px; display: flex; align-items: center; padding: 0 6px; border-radius: 20px; border: 1.5px solid var(--line); background: var(--ground); }
.tv-row { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 10px; background: var(--surface-2); font-size: 11px; }
.tv-row .photo { flex: none; width: 22px; border-radius: 4px; background-size: 70%; }
.tv-row > span:nth-child(2) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-row b { font-weight: 600; white-space: nowrap; }
.tv-phone .tv-row { flex-direction: column; align-items: flex-start; gap: 4px; }
.tv-phone .tv-row > span:nth-child(2) { width: 100%; }
.tv-arc { width: 18%; height: 60px; align-self: flex-start; margin-top: 24px; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 3 4; }

/* 2 · undo, for seven seconds */
.toast {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; border-radius: 999px; overflow: hidden;
  background: var(--surface-2); font-size: 14px;
}
.toast b { color: var(--accent); }
.toast .drain { position: absolute; left: 18px; right: 18px; bottom: 5px; height: 2px; border-radius: 1px; background: var(--accent); transform-origin: 0 50%; }
.tile.live .toast .drain { animation: drain 7s linear infinite; }
@keyframes drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* 3 · Opening hours, After hours: the app's switch flips the tile */
.theme-switch {
  position: relative; width: 132px; height: 60px; padding: 0; border-radius: 30px;
  border: 1px solid var(--line); background: var(--surface-2);
}
.ts-bars { position: absolute; right: 22px; top: 50%; display: flex; gap: 4px; transform: translateY(-50%); }
.ts-bars i { width: 3px; height: 20px; border-radius: 1px; background: var(--muted); opacity: .6; }
.theme-switch[aria-pressed="true"] .ts-bars { right: auto; left: 22px; }
.ts-thumb {
  position: absolute; left: 6px; top: 6px; width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; background: var(--accent); color: var(--on-accent);
  transition: transform .45s var(--ease);
}
.theme-switch[aria-pressed="true"] .ts-thumb { transform: translateX(72px); }
.ts-thumb svg { width: 20px; height: 20px; fill: currentColor; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.ts-thumb .sun { display: none; fill: none; }
.theme-switch[aria-pressed="true"] .sun { display: block; }
.theme-switch[aria-pressed="true"] .moon { display: none; }
.tile[data-tile="theme"] { transition: background-color .45s var(--ease), color .45s var(--ease); }

/* 4 · one of one, even twice */
.twins { gap: 18px; --tag-w: 66px; }
.twins .tag:first-child { transform: rotate(-6deg); }
.twins .tag:last-child { transform: rotate(5deg) translateY(8px); }
.twins .tag-hole { background: var(--surface); }

/* 5 · on your Home Screen */
[data-tile="home"] .tile-visual { flex-direction: column; gap: 8px; }
.app-icon { position: relative; width: 76px; height: 76px; border-radius: 18px; background: #141D23; box-shadow: 0 10px 24px -10px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,.06); }
.app-icon svg { position: absolute; left: 50%; top: 50%; height: 82%; aspect-ratio: 695 / 845; transform: translate(-50%, -50%); color: #F4E5DA; filter: drop-shadow(0 0 2px rgba(244,229,218,.55)) drop-shadow(0 0 6px rgba(244,229,218,.2)); overflow: visible; }
.app-icon-name { font-size: 13px; color: var(--muted); }

/* 6 · made for patchy wifi */
.sync-rows { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 8px; }
.sync-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); font-family: var(--font-mono); font-size: 13px; }
.sync-row .st { position: relative; width: 22px; height: 22px; }
.sync-row svg { position: absolute; inset: 0; width: 22px; height: 22px; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: opacity .35s var(--ease); }
.sync-row .cloud { stroke: var(--muted); opacity: 0; }
.sync-row .tick { stroke: var(--accent); stroke-width: 2; }
.sync-row.waiting .cloud { opacity: 1; }
.sync-row.waiting .tick { opacity: 0; }

@media (max-width: 899px) {
  .tv-screen { height: 96px; }
  .tv-phone { height: 124px; }
}
@media (max-width: 767px) {
  .ai { --lamp-x: 86%; }
  .lamp-shade { transform: scale(.75); transform-origin: 50% 0; }
}
