/* Download interim page. The install walkthrough is the component from
   _Projects - Personal/Install Walkthrough Animation/ (README there),
   re-themed through its own tokens; the geometry, timeline and cursor
   logic are untouched so it can be updated from the source. Added
   2026-09-13 at Steven's request: "give an interim screen when
   downloading something and how to install it just in case they don't
   know." */
.dl-page { max-width: var(--content); margin: 0 auto; padding: clamp(28px, 4vw, 56px) var(--gut) 72px; }
.dl-head { max-width: 720px; margin-bottom: 28px; }
.dl-kick { font-size: 10.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.dl-kick .picon { width: 18px; height: 18px; }
.dl-kick .dl-ver { text-transform: none; letter-spacing: .04em; }
.dl-head h1 { font-family: var(--display); font-size: clamp(30px, 3.6vw, 48px); line-height: 1.05; letter-spacing: -.028em; margin: 0 0 14px; }
.dl-head p { font-size: 17px; line-height: 1.55; color: var(--ink-2); margin: 0; }
.dl-head p a { color: var(--lavender-hi); white-space: nowrap; }
.dl-fallback { margin-top: 6px !important; }
.dl-status { display: block; margin-top: 14px; font-size: 14px; color: var(--ink-2); }
.dl-frame { max-width: 960px; border-radius: var(--r-glass); overflow: hidden; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 30px 80px -30px rgba(0,0,0,.7); }
.dl-after { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 28px; font-size: 14px; color: var(--ink-2); }
.dl-after a { color: var(--lavender-hi); }

/* ============================================================
     COMPONENT
     ============================================================ */
  .iw, .iw *, .iw *::before, .iw *::after { box-sizing: border-box; }

  .iw {
    /* ---- theme tokens, Vesper ---- */
    --iw-accent:        var(--amber, #fdbb25);      /* cursor, active toolbar chip */
    --iw-accent-ink:    #1c1206;
    --iw-stage:         #150d3a;                    /* the desktop: the glow's deep violet */
    --iw-panel:         rgba(12, 15, 34, .72);      /* left panel: glass over the sky */
    --iw-panel-ink:     var(--ink, #f2f5ff);
    --iw-panel-ink-dim: var(--ink-2, #e2e7f2);
    --iw-chrome:        #f2f2f4;                    /* the mock browser stays a light Mac window */
    --iw-surface:       #ffffff;
    --iw-surface-ink:   #17181b;
    --iw-line:          #e5e5e8;
    --iw-app-bg:        var(--iw-product, #784a9d); /* the app tile takes the product accent */
    --iw-app-ink:       #ffffff;
    --iw-folder:        #4aa8f0;                    /* Applications folder: Mac folder blue (Steven, 2026-09-13) */
    --iw-speed:         1;
    --iw-font-display:  var(--display, "Bricolage Grotesque", sans-serif);
    --iw-font-ui:       var(--body-font, "Gabarito", sans-serif);

    /* ---- internals ---- */
    --u: 1cqw;
    container-type: inline-size;
    position: relative;
    aspect-ratio: 71 / 50;
    display: flex;
    overflow: hidden;
    border-radius: calc(1 * var(--u));
    background: var(--iw-stage);
    font-family: var(--iw-font-ui);
    color: var(--iw-surface-ink);
    -webkit-user-select: none;
    user-select: none;
    cursor: pointer;
  }

  /* ---------------- left panel ---------------- */
  .iw-panel {
    position: relative;
    z-index: 4;
    flex: 0 0 43%;
    min-width: 0;
    background: var(--iw-panel);
    color: var(--iw-panel-ink);
    padding: calc(2.5 * var(--u)) calc(1.5 * var(--u)) calc(2.5 * var(--u)) calc(9 * var(--u));
    display: flex;
    flex-direction: column;
  }
  .iw-panel > * { max-width: calc(31 * var(--u)); }

  .iw-mark {
    display: flex;
    align-items: center;
    gap: calc(0.8 * var(--u));
    margin-top: calc(16 * var(--u));
    font-size: calc(1.85 * var(--u));
    font-weight: 600;
    letter-spacing: -0.015em;
  }
  .iw-mark svg { width: calc(2.1 * var(--u)); height: calc(2.1 * var(--u)); display: block; flex: none; }

  .iw-head {
    font-family: var(--iw-font-display);
    font-weight: 700;
    font-size: calc(3.35 * var(--u));
    line-height: 1.12;
    letter-spacing: -0.012em;
    margin: calc(4.5 * var(--u)) 0 0;
  }
  .iw-steps {
    margin: calc(4 * var(--u)) 0 0;
    padding-left: calc(1.6 * var(--u));
    font-size: calc(1.25 * var(--u));
    line-height: 1.75;
  }
  .iw-note {
    margin: calc(2 * var(--u)) 0 0;
    font-size: calc(1.1 * var(--u));
    color: var(--iw-panel-ink-dim);
  }
  .iw-link { text-decoration: underline; text-underline-offset: 0.22em; }

  .iw-foot {
    margin-top: auto;
    align-self: flex-end;
    display: flex;
    align-items: center;
    gap: calc(1 * var(--u));
    background: #ffffff17;
    border-radius: calc(0.5 * var(--u));
    padding: calc(0.8 * var(--u)) calc(1.1 * var(--u));
    font-size: calc(0.85 * var(--u));
    line-height: 1.35;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--iw-panel-ink-dim);
  }
  .iw-foot svg { width: calc(3.4 * var(--u)); height: calc(3.4 * var(--u)); display: block; flex: none; }

  /* ---------------- stage ---------------- */
  .iw-stage { position: relative; flex: 1 1 auto; min-width: 0; }

  /* the browser window bleeds off to the left, behind the panel */
  .iw-browser {
    position: absolute;
    left: calc(-9 * var(--u));
    top: calc(19 * var(--u));
    width: calc(52.8 * var(--u));
    height: calc(54 * var(--u));
    background: var(--iw-surface);
    border-radius: calc(1.1 * var(--u));
    box-shadow: 0 calc(1 * var(--u)) calc(4 * var(--u)) rgb(0 0 0 / 0.22);
    overflow: hidden;
  }
  .iw-bar {
    height: calc(5.6 * var(--u));
    background: var(--iw-chrome);
    border-bottom: 1px solid var(--iw-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 calc(1.2 * var(--u));
    gap: calc(1.6 * var(--u));
  }
  .iw-url {
    flex: 1 1 auto;
    min-width: 0;
    height: calc(3 * var(--u));
    background: #fff;
    border-radius: calc(1.5 * var(--u));
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 calc(0.9 * var(--u));
    box-shadow: inset 0 0 0 1px var(--iw-line);
  }
  .iw-tools { display: flex; align-items: center; gap: calc(0.4 * var(--u)); flex: none; }
  .iw-tool {
    width: calc(3.4 * var(--u));
    height: calc(3.4 * var(--u));
    border-radius: calc(0.7 * var(--u));
    display: grid;
    place-items: center;
    color: #57585d;
    transition: background 200ms ease, color 200ms ease, transform 140ms ease;
  }
  .iw-tool svg { width: calc(2 * var(--u)); height: calc(2 * var(--u)); display: block; }
  .iw-icon-sm svg { width: calc(1.6 * var(--u)); height: calc(1.6 * var(--u)); display: block; color: #8c8d93; }

  .iw.is-armed   .iw-tool--dl { background: var(--iw-accent); color: var(--iw-accent-ink); }
  .iw.is-pressed .iw-tool--dl { transform: scale(0.86); }

  .iw-page { padding: calc(4 * var(--u)) calc(3 * var(--u)); display: grid; gap: calc(1.8 * var(--u)); }
  .iw-skel { height: calc(2.4 * var(--u)); border-radius: calc(0.5 * var(--u)); background: #f2f2f4; }
  .iw-skel:nth-child(1) { width: 66%; }
  .iw-skel:nth-child(2) { width: 47%; }

  /* ---------------- download popover ---------------- */
  .iw-pop {
    position: absolute;
    top: calc(25.6 * var(--u));
    right: calc(15.5 * var(--u));
    display: flex;
    align-items: center;
    gap: calc(1 * var(--u));
    background: var(--iw-surface);
    border-radius: calc(0.9 * var(--u));
    padding: calc(1 * var(--u)) calc(1.6 * var(--u)) calc(1 * var(--u)) calc(1 * var(--u));
    box-shadow: 0 calc(0.6 * var(--u)) calc(2.2 * var(--u)) rgb(0 0 0 / 0.22);
    font-size: calc(1.5 * var(--u));
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(calc(-1 * var(--u))) scale(0.96);
    transform-origin: 84% 0;
    transition: opacity 240ms ease, transform 320ms cubic-bezier(.2,.9,.3,1.12);
    z-index: 3;
  }
  .iw.is-popped .iw-pop { opacity: 1; transform: none; }
  .iw-pop svg { width: calc(2.8 * var(--u)); height: calc(2.8 * var(--u)); display: block; flex: none; }

  /* ---------------- disk image window ---------------- */
  .iw-dmg {
    position: absolute;
    left: calc(18.5 * var(--u));
    top: calc(37 * var(--u));
    width: calc(33.5 * var(--u));
    height: calc(23.5 * var(--u));   /* 3.2u bar + a 1.65:1 body, the shipped artwork's aspect */
    background: var(--iw-surface);
    border-radius: calc(0.9 * var(--u));
    box-shadow: 0 calc(1.2 * var(--u)) calc(4 * var(--u)) rgb(0 0 0 / 0.3);
    overflow: hidden;
    opacity: 0;
    transform: translateY(calc(1.8 * var(--u))) scale(0.95);
    transform-origin: 50% 80%;
    transition: opacity 300ms ease, transform 420ms cubic-bezier(.2,.9,.3,1.06);
    z-index: 2;
  }
  .iw.is-mounted   .iw-dmg { opacity: 1; transform: none; }
  .iw.is-measuring .iw-dmg,
  .iw.is-measuring .iw-pop,
  .iw.is-measuring .iw-app-tile { transform: none; transition: none; }
  /* .iw-app-tile added 2026-09-13: on every loop after the first, reset()
     drops is-dropped and measure() runs in the same tick, so the tile was
     still transformed onto the folder when its box was read. The "app" stop
     and --dx/--dy were then measured at the folder, and the second pass
     clicked the folder, jumped the tile, and clicked the folder again. */

  .iw-dmg-bar {
    height: calc(3.2 * var(--u));
    background: #eeeef0;
    border-bottom: 1px solid var(--iw-line);
    display: flex;
    align-items: center;
    padding: 0 calc(1 * var(--u));
    gap: calc(0.55 * var(--u));
    position: relative;
  }
  .iw-dot { width: calc(0.85 * var(--u)); height: calc(0.85 * var(--u)); border-radius: 50%; background: #d0d1d5; }
  .iw-dmg-title {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: calc(0.5 * var(--u));
    font-size: calc(1.15 * var(--u));
    font-weight: 600;
    color: #4a4b50;
  }
  .iw-dmg-title svg { width: calc(1.25 * var(--u)); height: calc(1.25 * var(--u)); display: block; }
  /* The real disk-image background ships in the window, per product
     (src/static/img/dmg/<id>.png, copied from each app's build folder).
     The nebula sits at 33% of the width and the arrow points to 72%, so
     the app tile and the Applications folder are placed there. */
  .iw-dmg-body { position: relative; height: calc(100% - 3.2 * var(--u));
    background: var(--iw-dmg-bg) center / 100% 100% no-repeat, #0f1428; }
  .iw-dmg-body .iw-label { color: rgba(255,255,255,.88); }

  .iw-app, .iw-dest {
    position: absolute;
    top: calc(7.35 * var(--u));   /* tile center at 51% of the 20.3u body */
    width: calc(8 * var(--u));
    display: grid;
    justify-items: center;
    gap: calc(0.7 * var(--u));
  }
  .iw-app  { left: calc(6.62 * var(--u));  z-index: 2; }   /* center at 31.7% of 33.5u, the nebula */
  .iw-dest { left: calc(18.78 * var(--u)); }              /* center at 68%, mirrored across the arrow */

  .iw-app-tile {
    width: calc(6 * var(--u));
    height: calc(6 * var(--u));
    border-radius: calc(1.4 * var(--u));
    background: var(--iw-app-bg);
    color: var(--iw-app-ink);
    display: grid;
    place-items: center;
    box-shadow: 0 calc(0.25 * var(--u)) calc(0.7 * var(--u)) rgb(0 0 0 / 0.22);
    transition: transform 380ms cubic-bezier(.4,0,.2,1), opacity 220ms ease, box-shadow 240ms ease;
  }
  .iw-app-tile svg { width: calc(3.4 * var(--u)); height: calc(3.4 * var(--u)); display: block; }

  /* lifted, carried across, then dropped into the folder */
  .iw.is-dragging .iw-app-tile {
    box-shadow: 0 calc(0.9 * var(--u)) calc(1.8 * var(--u)) rgb(0 0 0 / 0.32);
    transform: scale(1.07);
  }
  .iw.is-carrying .iw-app-tile {
    transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(1.07);
    transition: transform 1000ms cubic-bezier(.45,.05,.2,1), box-shadow 240ms ease;
  }
  .iw.is-dropped .iw-app-tile {
    transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(0.26);
    opacity: 0;
    transition: transform 360ms cubic-bezier(.4,0,.2,1), opacity 260ms ease;
  }

  .iw-folder-glyph {
    width: calc(6 * var(--u));
    height: calc(6 * var(--u));
    color: var(--iw-folder);
    display: grid;
    place-items: center;
    border-radius: calc(1 * var(--u));
    transition: transform 240ms ease, background 240ms ease;
  }
  .iw-folder-glyph svg { width: 100%; height: 100%; display: block; }
  .iw.is-over .iw-folder-glyph {
    background: color-mix(in srgb, var(--iw-folder) 22%, transparent);
    transform: scale(1.07);
  }
  .iw-label { font-size: calc(1.05 * var(--u)); color: #55565b; transition: opacity 240ms ease; }
  .iw.is-carrying .iw-app .iw-label,
  .iw.is-dropped  .iw-app .iw-label { opacity: 0; }

  /* ---------------- cursor ---------------- */
  .iw-cursor {
    position: absolute;
    left: 0; top: 0;
    width: calc(2.7 * var(--u));
    height: calc(2.7 * var(--u));
    z-index: 6;
    pointer-events: none;
    transform: translate(var(--cx, 66cqw), var(--cy, 45cqw));
    transition: transform var(--cdur, 900ms) cubic-bezier(.45,.05,.2,1);
    filter: drop-shadow(0 calc(0.2 * var(--u)) calc(0.4 * var(--u)) rgb(0 0 0 / 0.3));
  }
  .iw-cursor svg { width: 100%; height: 100%; display: block; }
  .iw-cursor .iw-grab { display: none; }
  .iw.is-dragging .iw-cursor .iw-grab  { display: block; }
  .iw.is-dragging .iw-cursor .iw-arrow { display: none; }

  /* ---------------- stacked layout on small screens ---------------- */
  @media (max-width: 620px) {
    .iw { aspect-ratio: 4 / 5; flex-direction: column; }
    .iw-panel {
      flex: 0 0 auto;
      padding: calc(6 * var(--u)) calc(6 * var(--u)) calc(5 * var(--u));
    }
    .iw-panel > * { max-width: none; }
    .iw-mark  { margin-top: 0; font-size: calc(3.6 * var(--u)); }
    .iw-mark svg { width: calc(4 * var(--u)); height: calc(4 * var(--u)); }
    .iw-head  { font-size: calc(6.4 * var(--u)); margin-top: calc(3 * var(--u)); }
    .iw-steps { font-size: calc(2.4 * var(--u)); margin-top: calc(2.5 * var(--u)); }
    .iw-note  { font-size: calc(2.1 * var(--u)); }
    .iw-foot  { display: none; }

    .iw-browser { left: calc(7 * var(--u)); top: calc(5 * var(--u)); width: calc(86 * var(--u)); height: calc(60 * var(--u)); }
    .iw-bar   { height: calc(8 * var(--u)); }
    .iw-url   { height: calc(4.6 * var(--u)); }
    .iw-tool  { width: calc(5.2 * var(--u)); height: calc(5.2 * var(--u)); }
    .iw-tool svg { width: calc(3 * var(--u)); height: calc(3 * var(--u)); }
    .iw-skel  { height: calc(3.4 * var(--u)); }
    .iw-pop   { top: calc(15 * var(--u)); right: calc(9 * var(--u)); font-size: calc(2.3 * var(--u)); }
    .iw-pop svg { width: calc(4.2 * var(--u)); height: calc(4.2 * var(--u)); }
    .iw-dmg   { left: calc(18 * var(--u)); top: calc(25 * var(--u)); width: calc(64 * var(--u)); height: calc(44.2 * var(--u)); }
    .iw-dmg-bar { height: calc(5.4 * var(--u)); }
    .iw-dmg-body { height: calc(100% - 5.4 * var(--u)); }
    .iw-dmg-title { font-size: calc(2 * var(--u)); }
    .iw-dmg-title svg { width: calc(2.2 * var(--u)); height: calc(2.2 * var(--u)); }
    .iw-dot   { width: calc(1.5 * var(--u)); height: calc(1.5 * var(--u)); }
    .iw-app, .iw-dest { top: calc(13.3 * var(--u)); width: calc(18 * var(--u)); }
    .iw-app   { left: calc(11.3 * var(--u)); }
    .iw-dest  { left: calc(34.5 * var(--u)); }
    .iw-app-tile { width: calc(13 * var(--u)); height: calc(13 * var(--u)); border-radius: calc(3 * var(--u)); }
    .iw-app-tile svg { width: calc(7.4 * var(--u)); height: calc(7.4 * var(--u)); }
    .iw-folder-glyph { width: calc(13 * var(--u)); height: calc(13 * var(--u)); }
    .iw-label { font-size: calc(2.1 * var(--u)); }
    .iw-cursor { width: calc(5.4 * var(--u)); height: calc(5.4 * var(--u)); }
  }

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