/* Hero demo: a 1:1 recreation of the AI Island app.
   Everything inside .screen is laid out in macOS points (a 1512x982 MacBook Pro screen)
   using the same sizes as the SwiftUI app, then scaled to fit with --s. */

.demo {
  --s: 0.68;
  /* Visible crop of the 1512x982 screen, centered on the notch */
  --vw: 1120; --vh: 700; --ox: 196; --oy: 0;
  position: relative; margin: 64px auto 0; width: min(1040px, 100%);
  aspect-ratio: var(--vw) / var(--vh);
  border-radius: 22px; overflow: hidden; text-align: left;
  box-shadow: 0 0 0 1px var(--stroke-strong), 0 40px 120px rgba(76, 180, 255, .18), 0 30px 60px rgba(0,0,0,.6);
  background: #000;
}
.screen {
  position: absolute; left: 0; top: 0; width: 1512px; height: 982px;
  transform-origin: 0 0;
  transform: scale(var(--s)) translate(calc(var(--ox) * -1px), calc(var(--oy) * -1px));
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", sans-serif;
  color: #fff; -webkit-font-smoothing: antialiased; overflow: hidden;
  background:
    radial-gradient(900px 700px at 12% 115%, #0d5ea8 0%, transparent 60%),
    radial-gradient(800px 700px at 100% 105%, #23338a 0%, transparent 62%),
    radial-gradient(1000px 600px at 60% 25%, #0a1c33 0%, transparent 70%),
    #02060d;
}

/* macOS menu bar */
.d-menubar {
  position: absolute; inset: 0 0 auto 0; height: 32px;
  /* keep menu items inside the visible crop */
  padding: 0 calc(1512px - var(--ox) * 1px - var(--vw) * 1px + 18px) 0 calc(var(--ox) * 1px + 18px);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13.5px; color: rgba(255,255,255,.92); background: rgba(0,0,0,.25);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.d-menubar .l, .d-menubar .r { display: flex; gap: 20px; align-items: center; }
.d-menubar .r { gap: 18px; }
.d-menubar b { font-weight: 700; }
.d-menubar svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 1.6; }
.d-menubar svg.st { width: 17px; height: 17px; }
.d-menubar svg.spark { fill: #fff; stroke: none; width: 18px; height: 18px; }
.d-menubar .apple { width: 15px; height: 15px; fill: #fff; stroke: none; }

/* Notes window */
.d-notes {
  position: absolute; left: 236px; top: 118px; width: 620px; height: 440px; border-radius: 12px;
  background: rgba(30, 30, 32, .96); overflow: hidden;
  box-shadow: 0 0 0 .5px rgba(255,255,255,.18), 0 30px 80px rgba(0,0,0,.55);
}
.d-notes .tb { height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 18px; border-bottom: 1px solid rgba(255,255,255,.06); }
.d-notes .tb i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.d-notes .tb i:nth-child(1) { background: #ff5f57; } .d-notes .tb i:nth-child(2) { background: #febc2e; } .d-notes .tb i:nth-child(3) { background: #28c840; }
.d-notes .body { padding: 30px 46px; font-size: 16px; line-height: 1.7; color: rgba(255,255,255,.86); }
.d-notes h3 { font-size: 26px; font-weight: 700; color: #fff; margin-bottom: 6px; letter-spacing: -.01em; font-family: inherit; }
.d-notes .date { font-size: 13px; color: rgba(255,255,255,.4); margin-bottom: 18px; }
.d-notes ul { list-style: none; }
.d-notes li { padding-left: 18px; position: relative; }
.d-notes li::before { content: "•"; position: absolute; left: 0; color: rgba(255,255,255,.5); }
.d-notes .sel { transition: background .15s; border-radius: 3px; }
.d-notes.selected .sel { background: rgba(10, 132, 255, .45); }

/* Keyboard shortcut hint */
.d-key {
  position: absolute; left: 50%; top: calc(var(--vh) * 1px - 190px); transform: translateX(-50%) translateY(10px);
  display: flex; gap: 6px; opacity: 0; transition: opacity .2s, transform .2s;
}
.d-key.show { opacity: 1; transform: translateX(-50%); }
.d-key span {
  min-width: 46px; height: 46px; padding: 0 12px; border-radius: 10px; display: grid; place-items: center;
  font-size: 20px; font-weight: 600; color: #fff; background: rgba(20,22,28,.9);
  box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 8px 24px rgba(0,0,0,.4);
}

/* ---------- The island (NotchRootView) ---------- */
.nb {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: var(--nw, 185px); height: var(--nh, 32px);
  background: #000; border-radius: 0 0 12px 12px; overflow: hidden; z-index: 10;
  transition:
    width .5s cubic-bezier(.32,1.25,.5,1), height .5s cubic-bezier(.32,1.25,.5,1),
    border-radius .4s ease, box-shadow .3s;
}
.nb.open { border-radius: 0 0 26px 26px; box-shadow: 0 4px 12px rgba(0,0,0,.45); }

/* Collapsed live activity (CollapsedActivityView) */
.nb-act { position: absolute; inset: 0; display: flex; align-items: center; opacity: 0; transition: opacity .25s; }
.nb.activity:not(.open) .nb-act { opacity: 1; transition-delay: .2s; }
.nb-act .w { width: 86px; display: grid; place-items: center; }
.nb-act .gap { flex: 1; }
.nb-act .t { width: 78px; margin-right: 8px; font-size: 11px; font-weight: 500; color: rgba(255,255,255,.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(143,211,255,.25); border-top-color: #8fd3ff; animation: dspin .8s linear infinite; }
@keyframes dspin { to { transform: rotate(360deg); } }
.nb-act svg { width: 15px; height: 15px; }

/* Expanded (ExpandedView): padding 18 h, 16 bottom; header height 32 */
.nb-exp { position: absolute; left: 0; top: 0; width: 632px; height: 396px; padding: 0 18px 16px; opacity: 0; transition: opacity .2s; display: flex; flex-direction: column; gap: 10px; }
.nb.open .nb-exp { opacity: 1; transition-delay: .18s; }
.nb-head { height: 32px; display: flex; align-items: center; gap: 10px; flex: 0 0 32px; }
.nb-head .side { flex: 1; display: flex; align-items: center; gap: 8px; }
.nb-head .side.r { justify-content: flex-end; }
.nb-head .cam { width: 185px; flex: 0 0 185px; }
.nb-head .title { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.9); }
.ib { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.06); }
.ib svg { width: 13px; height: 13px; stroke: rgba(255,255,255,.75); fill: none; stroke-width: 2; }
.ib.hide { display: none; }

.page { display: none; flex: 1; min-height: 0; }
.page.on { display: flex; animation: dfade .25s ease; }
@keyframes dfade { from { opacity: 0; } to { opacity: 1; } }

/* Home (HomeGridView) */
.p-home { flex-direction: column; gap: 14px; padding-top: 4px; }
.grid5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.htile {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 0; border-radius: 18px;
  background: rgba(255,255,255,.06); box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset; transition: background .15s;
}
.htile.hover { background: rgba(255,255,255,.11); }
.htile svg { height: 30px; width: 30px; fill: none; stroke: #fff; stroke-width: 1.5; }
.htile.accent svg { stroke: #8fd3ff; }
.htile .n { font-size: 12px; font-weight: 600; }
.htile .s { font-size: 10px; font-weight: 500; color: rgba(255,255,255,.55); }
.htile .s.a { color: #8fd3ff; }
.quick {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 14px;
  background: rgba(255,255,255,.06); box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset; font-size: 13px;
}
.quick svg { width: 15px; height: 15px; fill: none; stroke: #8fd3ff; stroke-width: 1.6; }
.quick .ph { flex: 1; color: rgba(255,255,255,.35); }
.quick .k { font-size: 10px; font-weight: 500; color: rgba(255,255,255,.55); }

/* Agents (AgentsView) */
.p-agents { gap: 14px; }
.agents-l { width: 330px; flex: 0 0 330px; display: flex; flex-direction: column; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.atile {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0; border-radius: 14px;
  background: rgba(255,255,255,.06); box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset; transition: background .15s, box-shadow .15s;
}
.atile.hover { background: rgba(255,255,255,.11); }
.atile.pressed { box-shadow: 0 0 0 1.5px #8fd3ff inset; }
.atile svg.i { width: 20px; height: 22px; fill: none; stroke: #8fd3ff; stroke-width: 1.6; }
.atile .n { font-size: 11px; font-weight: 600; }
.atile svg.m { width: 10px; height: 10px; fill: none; stroke: rgba(255,255,255,.55); stroke-width: 1.6; }
.atile.new { background: none; box-shadow: none; border: 1px dashed rgba(255,255,255,.08); color: rgba(255,255,255,.55); }
.atile.new svg.i { stroke: rgba(255,255,255,.55); }
.agents-note { font-size: 10px; color: rgba(255,255,255,.55); }
.agents-r { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.agents-r .h { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; color: rgba(255,255,255,.55); }
.agents-r .empty { font-size: 12px; color: rgba(255,255,255,.55); line-height: 1.45; }
.run { padding: 10px; border-radius: 12px; background: rgba(255,255,255,.06); display: none; }
.run.on { display: block; animation: dfade .25s; }
.run .top { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; }
.run .top svg { width: 11px; height: 11px; fill: none; stroke: #8fd3ff; stroke-width: 1.8; }
.run .top .sp { flex: 1; }
.run .copy { font-size: 10px; color: #8fd3ff; display: none; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 6px; transition: background .15s; }
.run .copy.on { display: flex; }
.run .copy.flash { background: rgba(143,211,255,.18); }
.run .out { margin-top: 6px; font-size: 12px; line-height: 1.45; color: rgba(255,255,255,.88); white-space: pre-line; }

/* Chat (ChatView) */
.p-chat { flex-direction: column; gap: 10px; }
.msgs { flex: 1; display: flex; flex-direction: column; gap: 12px; overflow: hidden; justify-content: flex-end; }
.m-user {
  align-self: flex-end; max-width: 72%; padding: 10px; border-radius: 14px; font-size: 13px; line-height: 1.45;
  background: rgba(143,211,255,.22); color: rgba(255,255,255,.92);
}
.m-ai { max-width: 88%; font-size: 13px; line-height: 1.5; color: rgba(255,255,255,.92); white-space: pre-line; min-height: 18px; }
.m-ai .caret { display: inline-block; width: 7px; height: 14px; background: #8fd3ff; vertical-align: -2px; animation: dblink 1s steps(1) infinite; }
@keyframes dblink { 50% { opacity: 0; } }
.chat-in {
  display: flex; align-items: flex-end; gap: 10px; padding: 10px 14px; border-radius: 16px;
  background: rgba(255,255,255,.06); box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset; font-size: 13px;
}
.chat-in .txt { flex: 1; min-height: 18px; color: rgba(255,255,255,.92); }
.chat-in .txt:empty::before { content: "Ask Claude..."; color: rgba(255,255,255,.35); }
.chat-in .send { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #8fd3ff; }
.chat-in .send svg { width: 12px; height: 12px; stroke: #000; stroke-width: 2.6; fill: none; }

/* Cursor */
.d-cursor {
  position: absolute; left: 0; top: 0; width: 22px; height: 32px; z-index: 30; pointer-events: none;
  transform: translate(var(--cx, 600px), var(--cy, 500px));
  transition: transform .85s cubic-bezier(.45,.05,.2,1);
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.5));
}
.d-cursor.press svg { transform: scale(.85); transform-origin: 2px 2px; }
.d-cursor svg { transition: transform .1s; }

/* Sound toggle */
.sound-toggle {
  position: absolute; right: 14px; bottom: 14px; z-index: 40;
  display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; border: 0; cursor: pointer;
  font: 500 12px var(--ui); color: rgba(255,255,255,.85); background: rgba(10,14,20,.7);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 0 1px rgba(255,255,255,.14);
}
.sound-toggle svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.sound-toggle.on { color: #001426; background: #8fd3ff; box-shadow: none; }

/* Phones: crop the screen around the notch so the UI stays readable */
@media (max-width: 700px) {
  .demo { --vw: 680; --vh: 600; --ox: 416; --oy: 0; border-radius: 16px; margin-top: 40px; }
}

/* Notion-style homework page */
.d-notes.notion { background: #191919; }
.d-notes.notion .tb .crumbs { margin-left: 14px; font-size: 13px; color: rgba(255,255,255,.55); }
.d-notes.notion .body { padding: 26px 56px; }
.d-notes.notion .page-ico { font-size: 40px; line-height: 1; margin-bottom: 12px; }
.d-notes.notion h3 { font-size: 28px; }
.d-notes.notion .ex { margin-top: 16px; font-size: 16px; color: rgba(255,255,255,.86); }
.d-notes.notion .eq {
  margin-top: 10px; padding: 16px 18px; border-radius: 8px; background: rgba(255,255,255,.04);
  font: 500 24px/1.3 "Sentient", Georgia, serif; letter-spacing: .01em; color: #fff;
}
.d-notes.notion .muted-line { color: rgba(255,255,255,.45); margin-top: 18px; }
.d-notes.notion .work {
  margin-top: 12px; padding-left: 18px; min-height: 0; white-space: pre-line;
  font: 400 19px/1.55 "Sentient", Georgia, serif; color: rgba(255,255,255,.92);
  border-left: 2px solid transparent; transition: border-color .2s;
}
.d-notes.notion .work.on { border-left-color: rgba(143,211,255,.5); min-height: 30px; }
.d-notes.notion .work .caret { display: inline-block; width: 2px; height: 20px; background: #fff; vertical-align: -3px; animation: dblink 1s steps(1) infinite; }
.m-user .pasted {
  display: inline-block; margin-top: 6px; padding: 4px 8px; border-radius: 6px;
  background: rgba(0,0,0,.35); font-family: "Sentient", Georgia, serif; font-size: 14px;
}
.m-ai b { color: #fff; font-weight: 600; }
.m-ai .math { font-family: "Sentient", Georgia, serif; font-size: 14px; color: #dff3ff; }

/* macOS Dock with the real system icons, pinned to the bottom of the visible crop */
.d-dock {
  position: absolute; left: 50%; top: calc(var(--vh) * 1px - 80px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; padding: 4px 6px; border-radius: 20px; z-index: 5;
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(28px) saturate(170%); -webkit-backdrop-filter: blur(28px) saturate(170%);
  box-shadow: 0 0 0 1px rgba(255,255,255,.28) inset, 0 10px 30px rgba(0,0,0,.25);
}
.dock-app { width: 58px; height: 58px; position: relative; }
.dock-app img { width: 100%; height: 100%; display: block; }
.dock-app.running::after {
  content: ""; position: absolute; bottom: -2px; left: 50%; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: rgba(255,255,255,.8);
}
.dock-sep { width: 1px; height: 42px; margin: 0 7px; border-radius: 1px; background: rgba(255,255,255,.35); }

@media (max-width: 700px) {
  /* keep the homework inside the narrower phone crop (x 416 to 1096) */
  .d-notes { left: 436px; width: 640px; height: 380px; }
  .d-notes.notion .body { padding: 22px 40px; }
  .d-notes.notion .muted-line { display: none; }
  .d-notes.notion .page-ico { display: none; }
  .d-menubar .m-hide { display: none; }
  .d-dock { gap: 2px; }
  .dock-app { width: 58px; height: 58px; }
}
