/* Cypher Silk: the atmosphere reserved for the announcement templates, and its
   motion control. The control shares the shape, placement and tooltip of the
   site-wide ambient toggle (assets/site/chrome.css .site-ambient-toggle) while
   keeping its own contract with announcement-scene.js: aria-pressed="true"
   means the scene is moving, and the live label is
   [data-announcement-motion-label]. */
.announcements-page {
  --scene-black: #060406;
  position: relative;
  isolation: isolate;
  background: var(--scene-black);
}
.announcements-page::before,
.announcements-page::after { display: none; }
.announcements-page .announcement-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--scene-black) url('/assets/announcement-scene-still.svg?v=2') center / cover no-repeat;
  contain: strict;
}
.announcements-page .announcement-scene[data-scene-ready='true'] { background-image: none; }
.announcements-page .announcement-scene-canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity .6s;
}
.announcements-page .announcement-scene[data-scene-ready='true'] .announcement-scene-canvas { opacity: 1; }
.announcements-page .announcement-scene::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 4, 6, .1), rgba(6, 4, 6, .38) 22%, rgba(6, 4, 6, .48) 54%, rgba(6, 4, 6, .2) 78%, rgba(6, 4, 6, .06)),
    linear-gradient(180deg, rgba(6, 4, 6, .2), transparent 24%, rgba(6, 4, 6, .14));
}

/* Motion control ------------------------------------------------------------- */
.announcements-page .announcement-motion-toggle {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 60;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(230, 187, 198, .28);
  border-radius: 50%;
  background: rgba(10, 7, 10, .84);
  color: #ebe3de;
  cursor:var(--ki-cursor-link,pointer);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .35);
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}
.announcements-page .announcement-motion-toggle[hidden] { display: none; }
.announcements-page .announcement-motion-toggle:hover { color: #fff; border-color: rgba(236, 120, 140, .6); }
.announcements-page .announcement-motion-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.announcements-page .announcement-motion-icon { grid-area: 1 / 1; display: inline-flex; gap: 3px; align-items: center; justify-content: center; width: 12px; height: 12px; }
.announcements-page .announcement-motion-icon::before,
.announcements-page .announcement-motion-icon::after { content: ''; width: 3px; height: 11px; background: currentColor; }
.announcements-page .announcement-motion-toggle[aria-pressed='false'] .announcement-motion-icon::before {
  width: 0; height: 0; margin-left: 3px; background: none; border-left: 9px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent;
}
.announcements-page .announcement-motion-toggle[aria-pressed='false'] .announcement-motion-icon::after { display: none; }
/* The live state label is the tooltip, exactly where the shared toggle shows its own. */
.announcements-page [data-announcement-motion-label] {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  width: max-content;
  max-width: min(260px, 70vw);
  padding: 9px 12px;
  border: 1px solid rgba(230, 187, 198, .2);
  border-radius: 4px;
  background: rgba(10, 7, 10, .94);
  color: #ebe3de;
  font: 500 10px/1.4 "KI Chakra", "Chakra Petch", ui-monospace, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(6px, -50%);
  transition: opacity .18s, transform .18s;
}
.announcements-page .announcement-motion-toggle:is(:hover, :focus-visible) [data-announcement-motion-label] { opacity: 1; transform: translate(0, -50%); }

/* Reading plate: a quiet field behind long-form text on both article layouts. ---- */
.announcements-page .announcement-masthead { position: relative; }
.announcements-page .announcement-reading {
  position: relative;
  isolation: isolate;
}
/* The plate fades in over its first 120px so the silk dissolves into the
   reading field instead of ending at a hard horizontal edge. */
.announcements-page .announcement-reading::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -120px -40px -48px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(6, 4, 6, .7), rgba(6, 4, 6, .92) 20%, rgba(6, 4, 6, .9) 80%, rgba(6, 4, 6, .68));
  border-radius: 32px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 120px);
  mask-image: linear-gradient(180deg, transparent, #000 120px);
}
@media (max-width: 767px) {
  .announcements-page .announcement-scene { background-position: 64% center; }
  .announcements-page .announcement-scene::after {
    background: linear-gradient(90deg, rgba(6, 4, 6, .34), rgba(6, 4, 6, .5) 30%, rgba(6, 4, 6, .42) 70%, rgba(6, 4, 6, .2));
  }
  .announcements-page .announcement-motion-toggle { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
  .announcements-page .announcement-reading::before {
    inset: -88px -12px -28px;
    border-radius: 16px;
    background: rgba(6, 4, 6, .91);
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 72px);
    mask-image: linear-gradient(180deg, transparent, #000 72px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .announcements-page .announcement-motion-toggle,
  .announcements-page .announcement-scene-canvas,
  .announcements-page [data-announcement-motion-label] { transition: none; }
}
@media print {
  .announcements-page .announcement-scene,
  .announcements-page .announcement-motion-toggle { display: none !important; }
  .announcements-page .announcement-reading::before { display: none; }
}

/* Code uses this same renderer below its independent, unchanged hero. A sticky
   viewport keeps the authored ribbon proportions through the whole story; its
   own flow boundary prevents the scene from ever covering the hero. */
[data-code-story] {
  position: relative;
  isolation: isolate;
  overflow: clip;
}
[data-code-story-scene] {
  position: sticky;
  top: 0;
  z-index: 0;
  height: 100vh;
  height: 100svh;
  margin-bottom: -100vh;
  margin-bottom: -100svh;
  overflow: hidden;
  contain: strict;
  pointer-events: none;
  background: #060406 url('/assets/announcement-scene-still.svg?v=2') center / cover no-repeat;
}
[data-code-story-scene][data-scene-ready='true'] { background-image: none; }
[data-code-story-scene] canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity .6s;
}
[data-code-story-scene][data-scene-ready='true'] canvas { opacity: 1; }
[data-code-story-scene]::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 4, 6, .1), rgba(6, 4, 6, .38) 22%, rgba(6, 4, 6, .48) 54%, rgba(6, 4, 6, .2) 78%, rgba(6, 4, 6, .06)),
    linear-gradient(180deg, rgba(6, 4, 6, .2), transparent 24%, rgba(6, 4, 6, .14));
}
[data-code-story-motion][hidden] { display: none; }
@media (max-width: 767px) {
  [data-code-story-scene] { background-position: 64% center; }
  [data-code-story-scene]::after {
    background: linear-gradient(90deg, rgba(6, 4, 6, .34), rgba(6, 4, 6, .5) 30%, rgba(6, 4, 6, .42) 70%, rgba(6, 4, 6, .2));
  }
}
@media (prefers-reduced-motion: reduce) {
  [data-code-story-scene] canvas { transition: none; }
}
@media print {
  [data-code-story-scene], [data-code-story-motion] { display: none !important; }
}
