/* ============================================================================
   Extension (extension.html). Page-local styles. Shared tokens/components: forge.css.
   Anchors: hero lead + demo, lands split, ai stacked, templates split (object
   lead), works centred, install split, close centred on the glass object.
   ========================================================================== */

/* --------------------------------------------------------------- hero -- */
.xhero { position: relative; padding: calc(var(--nav-h) + clamp(32px, 6vh, 72px)) 0 clamp(56px, 9vh, 104px); overflow: hidden; isolation: isolate; }
.xhero__orbit { position: absolute; z-index: -1; right: -10%; top: 4%; width: min(900px, 64vw); max-width: none; opacity: 0.9; pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 50%, transparent 100%); mask-image: radial-gradient(closest-side, #000 50%, transparent 100%); }
:root:not([data-theme="light"]) .xhero__orbit { mix-blend-mode: screen; }
:root[data-theme="light"] .xhero__orbit { opacity: 0.22; filter: saturate(0.7); }
.xhero__grid { display: grid; grid-template-columns: minmax(0, 4.4fr) minmax(0, 7.6fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
.xhero__copy .d-hero { font-size: clamp(2.75rem, 1rem + 4.4vw, 5.4rem); max-width: 8.5ch; }
.xhero__copy .lede { margin-top: var(--s-5); }
.xhero__copy .btn-row { margin-top: var(--s-6); }
.xhero__copy .btn--primary .i:first-child { width: 1.2em; height: 1.2em; }
.xhero__try { display: flex; align-items: center; gap: 10px; margin-top: var(--s-5); color: var(--ink-3); }
.xhero__try b { color: var(--ink-2); font-weight: 600; }
.xhero__pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-text); animation: xpulse 2s infinite var(--ease-out); }
@keyframes xpulse { 0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent-text) 50%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }
.xhero.is-saved .xhero__pulse { animation: none; background: var(--ok); }

/* the browser: real HTML, generic page (no third-party trade dress) */
.browser { position: relative; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--e3), var(--edge); overflow: hidden; }
.browser__tabs { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; background: var(--bg-dusk); border-bottom: 1px solid var(--line); }
.browser__dots { display: flex; gap: 6px; } .browser__dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.browser__tab { height: 30px; margin-top: 10px; padding: 0 14px; border-radius: 9px 9px 0 0; background: var(--surface); font-size: 0.75rem; line-height: 30px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.browser__ext { margin-left: auto; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); }
.browser__ext .i { width: 15px; height: 15px; }
.browser__url { display: flex; align-items: center; gap: 8px; height: 38px; margin: 8px 12px; padding: 0 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-family: var(--f-mono); font-size: 0.75rem; color: var(--ink-3); }
.browser__url .i { width: 13px; height: 13px; }
.browser__body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; border-top: 1px solid var(--line); min-height: 400px; }

.prof { padding: 26px 26px 20px; }
.prof__head { display: flex; gap: 22px; align-items: flex-start; }
.prof__av { display: grid; place-items: center; width: 84px; height: 84px; flex: none; border-radius: 50%; background: linear-gradient(140deg, #f2c6a0, #b98aa8); color: #2a1220; font-weight: 700; font-size: 1.25rem; box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line-2); }
.prof__id { display: grid; gap: 6px; min-width: 0; }
.prof__id > b { font-size: 1.125rem; font-weight: 600; color: var(--ink); }
.prof__stats { display: flex; gap: 16px; font-size: 0.8125rem; color: var(--ink-2); }
.prof__stats b { color: var(--ink); }
.prof__name { font-size: 0.8125rem; font-weight: 600; color: var(--ink); }
.prof__bio { font-size: 0.8125rem; line-height: 1.5; color: var(--ink-2); }
.prof__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 22px; }
.prof__grid i { aspect-ratio: 5 / 4; border-radius: 4px; background: linear-gradient(150deg, color-mix(in oklab, var(--ink) 9%, transparent), color-mix(in oklab, var(--ink) 3%, transparent)); }
.prof__grid i:nth-child(1) { background: linear-gradient(160deg, #d9cfc2, #9c8f80); opacity: 0.45; }
.prof__grid i:nth-child(3) { background: linear-gradient(200deg, #bfc6cc, #6f7a86); opacity: 0.45; }
.prof__grid i:nth-child(5) { background: linear-gradient(170deg, #e4dccf, #b0a08a); opacity: 0.4; }
.prof__grid i:nth-child(2) { background: linear-gradient(150deg, #e7d7c4, #c9b39b); opacity: 0.55; }
.prof__grid i:nth-child(4) { background: linear-gradient(150deg, #c9d3cf, #8fa39c); opacity: 0.5; }
.prof__grid i:nth-child(6) { background: linear-gradient(150deg, #ddd0e4, #a99bb8); opacity: 0.5; }

/* the extension panel, docked right */
.xp { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--bg-dusk); border-left: 1px solid var(--line); }
.xp__head { display: flex; align-items: center; justify-content: space-between; }
.xp__brand { display: flex; align-items: center; gap: 8px; font-family: var(--f-display); font-weight: 700; font-size: 0.875rem; color: var(--ink); }
.xp__logo { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); font-size: 0.75rem; }
.xp__card, .col__card { display: grid; grid-template-columns: 34px 1fr; column-gap: 10px; row-gap: 8px; align-items: center; padding: 11px 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--e1); }
.xp__av { --h: 24; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(140deg, hsl(var(--h) 70% 80%), hsl(calc(var(--h) + 40) 40% 64%)); color: hsl(var(--h) 60% 16%); font-size: 0.6875rem; font-weight: 700; }
.xp__who { line-height: 1.25; min-width: 0; }
.xp__who b { display: block; font-size: 0.8125rem; color: var(--ink); }
.xp__who small { display: block; font-size: 0.75rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xp__tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 5px; }
.xp__tags span { padding: 2px 8px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-text); font-size: 0.6875rem; font-weight: 600; }
.xp__save { position: relative; display: grid; height: 44px; border: 0; border-radius: var(--r-md); background: var(--accent); color: var(--accent-ink); font-size: var(--t-sm); font-weight: 600; box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.22), 0 8px 20px -10px rgb(70 50 220 / 0.6); transition: transform var(--d-1) var(--ease-out), background-color var(--d-3) var(--ease-out); }
.xp__save > span { grid-area: 1 / 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: opacity var(--d-2) var(--ease-out), transform var(--d-3) var(--ease-out); }
.xp__save .i { width: 17px; height: 17px; }
.xp__save-b { opacity: 0; transform: translateY(8px); }
.xp__save[aria-pressed="true"] { background: color-mix(in oklab, var(--ok) 22%, var(--surface)); color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--ok) 50%, transparent); }
.xp__save[aria-pressed="true"] .xp__save-a { opacity: 0; transform: translateY(-8px); }
.xp__save[aria-pressed="true"] .xp__save-b { opacity: 1; transform: none; }
.xp__save[aria-pressed="true"] .i { color: var(--ok); }
.xp__save:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .xp__save[aria-pressed="false"]:hover { background: color-mix(in oklab, var(--accent) 88%, white); } }
.xp__lbl { margin-top: 4px; font-family: var(--f-mono); font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.xp__ideas { display: grid; gap: 6px; }
.xp__ideas li { padding: 8px 10px; border-radius: 12px 12px 12px 4px; border: 1px dashed color-mix(in oklab, var(--accent-text) 45%, transparent); font-size: 0.75rem; line-height: 1.45; color: var(--ink-2); }
.xp__chips { display: flex; flex-wrap: wrap; gap: 5px; }
.xp__chips span { padding: 4px 9px; border-radius: var(--r-pill); border: 1px solid var(--line-2); font-size: 0.6875rem; font-weight: 600; color: var(--ink-2); }

/* the pipeline column the card flies into */
.col { position: relative; margin-top: 18px; padding: 12px; border-radius: var(--r-lg); background: color-mix(in oklab, var(--surface) 70%, transparent); border: 1px solid var(--line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.col__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.col__n { font-size: 0.75rem; color: var(--ink-3); }
.col__undo { background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; margin-left: auto; font-size: 0.75rem; font-weight: 600; color: var(--accent-text); }
.col__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.col__slot { display: grid; place-items: center; min-height: 58px; border-radius: var(--r-md); border: 1px dashed var(--line-2); font-size: 0.75rem; color: var(--ink-3); text-align: center; padding: 6px; }
.col__slot.is-filled { border: 0; padding: 0; display: block; place-items: normal; min-height: 0; }
.col__slot .col__card { height: 100%; }
.col__card { grid-template-columns: 34px 1fr; min-height: 58px; }
.col__card.is-new { border-color: color-mix(in oklab, var(--accent-text) 70%, transparent); }
.col__card.is-in { animation: col-in 520ms var(--ease-out); }
@keyframes col-in { from { opacity: 0; } }
.flyer { position: fixed; z-index: 90; margin: 0; pointer-events: none; transform-origin: 0 0; box-shadow: var(--e3); }

/* -------------------------------------------------------------- lands -- */
.lands { padding: var(--section) 0; }
.lands__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-7); align-items: start; }
.lands__grid .d-2 { max-width: 14ch; }
.lands__list { margin: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-6); }
.lands__list > div { padding: var(--s-5) 0; border-bottom: 1px solid var(--line); }
.lands__list dt { font-weight: 600; color: var(--ink); }
.lands__list dd { margin: 4px 0 0; color: var(--ink-2); font-size: var(--t-sm); }

/* ----------------------------------------------------------------- ai -- */
.xai { padding: var(--section) 0; }
.xai__head .body { margin-top: var(--s-5); max-width: 44ch; }
.xai__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 88px); align-items: center; }
.xai__notes { margin-top: var(--s-7); }
.xai__frame { margin: 0; width: 100%; max-width: none; }
.xai__frame img { width: 100%; }
.xai__notes { border-top: 1px solid var(--line); }
.xai__notes li { padding: var(--s-5) 0; border-bottom: 1px solid var(--line); }
.xai__notes b { display: block; font-weight: 600; color: var(--ink); }
.xai__notes span { display: block; margin-top: 4px; color: var(--ink-2); font-size: var(--t-sm); }

/* ---------------------------------------------------------- templates -- */
.xtpl { padding: var(--section) 0; }
.xtpl__grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
.dm { padding: 18px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--e3), var(--edge); }
.dm__head { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.dm__head .xp__who { margin-right: auto; }
.dm__thread { display: grid; gap: 8px; padding: 16px 0; }
.dm__me, .dm__them { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: var(--t-sm); line-height: 1.5; }
.dm__me { justify-self: end; background: var(--surface-2); border-bottom-right-radius: 6px; color: var(--ink-2); }
.dm__them { justify-self: start; background: color-mix(in oklab, var(--accent) 16%, var(--surface)); border-bottom-left-radius: 6px; color: var(--ink); }
.dm__chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 0 10px; border-top: 1px solid var(--line); }
.dm__chips button { height: 36px; padding: 0 13px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: none; font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); transition: background-color var(--d-1) var(--ease-out), color var(--d-1) var(--ease-out), border-color var(--d-1) var(--ease-out), transform var(--d-1) var(--ease-out); }
.dm__chips button:hover { color: var(--ink); border-color: var(--ink-3); }
.dm__chips button:active { transform: scale(0.97); }
.dm__chips button.is-on { background: var(--accent-soft); border-color: color-mix(in oklab, var(--accent-text) 60%, transparent); color: var(--ink); }
.dm__text { display: block; width: 100%; min-height: 96px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); resize: none; font-size: var(--t-sm); line-height: 1.55; color: var(--ink); }
.dm__text:focus { outline: 2px solid var(--accent-text); outline-offset: 1px; }
.dm__text.is-new { animation: mark-in2 600ms var(--ease-out); }
@keyframes mark-in2 { from { background: var(--accent-soft); } }
.xtpl__copy .body { margin-top: var(--s-5); }
.xtpl__hint { margin-top: var(--s-4); color: var(--ink-3); }

/* -------------------------------------------------------------- works -- */
.works-film .film__media > img, .works-film .film__media > video { object-position: 70% 50%; }
.works-film .film__copy > * { max-width: 36rem; }
.works-film .film__copy .body { max-width: 34ch; }
.works-film .d-2 { max-width: 13ch; }
@media (min-width: 861px) { .works-film .film__media > img, .works-film .film__media > video { transform: translateX(13%) scale(1.26); } }
.works-film .works { margin-top: var(--s-6); gap: var(--s-2) var(--s-5); color: #a9a3c4; }
.works-film .works .label { color: #a9a3c4; }
.works-film .works b { color: #efecf7; }

/* ------------------------------------------------------------ install -- */
.install { padding: var(--section) 0; }
.install__grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
.steps-l { margin-top: var(--s-7); border-top: 1px solid var(--line); }
.steps-l li { display: grid; grid-template-columns: 44px 1fr; column-gap: 16px; padding: var(--s-5) 0; border-bottom: 1px solid var(--line); }
.steps-l__ico { grid-row: span 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent-text); }
.steps-l b { font-size: var(--t-lg); font-weight: 600; letter-spacing: -0.015em; color: var(--ink); }
.steps-l li > span:not(.steps-l__ico) { grid-column: 2; color: var(--ink-2); font-size: var(--t-sm); }
.install__frame { margin: 0; }
.install__frame img { width: 100%; }

/* -------------------------------------------------------------- close -- */
.xclose { position: relative; min-height: 92vh; min-height: 92svh; display: grid; place-items: center; overflow: hidden; padding: var(--section) 0; text-align: center; isolation: isolate; }
.xclose__obj { position: absolute; z-index: -1; left: 50%; top: 50%; width: min(1240px, 150vw); max-width: none; transform: translate(-50%, -22%); opacity: 0.7;
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent 100%); mask-image: radial-gradient(closest-side, #000 55%, transparent 100%); }
:root:not([data-theme="light"]) .xclose__obj { mix-blend-mode: screen; }
:root[data-theme="light"] .xclose__obj { opacity: 0.35; }
.xclose__inner { display: grid; justify-items: center; transform: translateY(-8vh); }
.xclose__inner .d-1 { max-width: 14ch; }
.xclose__btn { --h: 72px; margin-top: var(--s-7); padding: 0 2em; border-radius: var(--r-lg); font-size: var(--t-lg); gap: 0.7em; }
.xclose__btn .i { width: 1.15em; height: 1.15em; }
.xclose__fine { margin-top: var(--s-5); color: var(--ink-2); }
.xclose__fine a { color: var(--ink); }

/* ------------------------------------------------------------- mobile -- */
@media (max-width: 1100px) {
  .xhero__grid { grid-template-columns: 1fr; }
  .xhero__copy .d-hero { max-width: 12ch; }
}
@media (max-width: 860px) {
  .lands__grid, .xai__grid, .xtpl__grid, .install__grid { grid-template-columns: 1fr; }
  .lands__list { grid-template-columns: 1fr; }
  .xtpl__copy { order: -1; }
}
@media (max-width: 760px) {
  .xhero__copy .d-hero { font-size: clamp(2.5rem, 11.4vw, 3.4rem); }
  .xhero__copy .lede { font-size: var(--t-base); }
  .xhero__copy .btn--lg { --h: 50px; padding: 0 1.1em; font-size: var(--t-sm); }
  .xhero__orbit { width: 140vw; right: -50%; top: 30%; }
  .browser__body { grid-template-columns: 1fr; min-height: 0; }
  .prof { padding: 16px; }
  .prof__head { gap: 14px; }
  .prof__av { width: 56px; height: 56px; font-size: 1rem; }
  .prof__grid, .prof__bio br, .prof__name { display: none; }
  .xp { border-left: 0; border-top: 1px solid var(--line); }
  .xp__ideas li:nth-child(2) { display: none; }
  .col__list { grid-template-columns: 1fr; }
  .col__list > li:nth-child(n+3) { display: none; }
  .works-film .film__media > img, .works-film .film__media > video { object-position: 62% 0%; height: 62%; }
  .works-film { min-height: 36rem; }
  .works-film .film__scrim { background: linear-gradient(0deg, rgb(7 6 13 / 1) 0%, rgb(7 6 13 / 0.94) 55%, rgb(7 6 13 / 0) 78%); }
  .works-film .works .label { flex-basis: 100%; }
  .xclose__btn { --h: 60px; font-size: var(--t-base); }
}

/* ----------------------------------------------------- reduced motion -- */
@media (prefers-reduced-motion: reduce) {
  .xhero__pulse { animation: none; }
  .col__card.is-in, .dm__text.is-new { animation: none; }
  .xp__save > span { transform: none !important; transition-duration: 1ms; }
}
