@import url('/page-css/experiments.css');

/* Chromatic Flow — experiment 08.
   One canvas band on a single stage, recoloured live by the picker below.
   The wave, its gradient and the soft halo are drawn per frame in canvas —
   no SVG filters, no blur passes, nothing that has to re-rasterise a layer. */

.ka-chromatic-page {
  --ka-chromatic-ink: #f5f5f7;
  --ka-chromatic-muted: #85848f;
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow: hidden;
  background: #050508;
  color: var(--ka-chromatic-ink);
}
.ka-chromatic-page:before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(ellipse at 50% 28%, rgba(41, 25, 83, .2), transparent 47%), radial-gradient(ellipse at 85% 76%, rgba(0, 95, 115, .1), transparent 38%);
  content: "";
}
.ka-chromatic {
  /* The five live colours ride on the root so stage and picker share them. */
  --c1: #00e5ff;
  --c2: #0066ff;
  --c3: #8a2be2;
  --c4: #ff2d95;
  --c5: #ff6b6b;
  width: min(100% - 64px, 1420px);
  margin: auto;
  padding: 42px 0 48px;
  font-family: Arial, Helvetica, sans-serif;
}

/* ---------- intro ---------- */
.ka-chromatic__intro {
  position: relative;
  display: flex;
  min-height: 340px;
  flex-direction: column;
  justify-content: center;
  padding: 45px 3.2% 34px;
  border-bottom: 1px solid rgba(255, 255, 255, .11);
}
.ka-chromatic__brand {
  position: absolute;
  top: 35px;
  left: 3.2%;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #a6a5ad;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .22em;
}
.ka-chromatic__brand-mark {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border: 1px solid rgba(30, 220, 255, .43);
  border-radius: 11px;
  background: linear-gradient(140deg, rgba(0, 190, 255, .28), rgba(74, 17, 255, .21));
  box-shadow: inset 0 0 18px rgba(0, 183, 255, .17), 0 0 27px rgba(0, 125, 255, .16);
  color: #fff;
  font-size: 14px;
  letter-spacing: -.1em;
}
.ka-chromatic__brand-mark span { color: #08d8ff; }
.ka-chromatic__brand i, .ka-chromatic__intro-foot i { padding: 0 5px; color: #25dfff; font-style: normal; }
.ka-chromatic__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  color: #aaa8b4;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .22em;
}
.ka-chromatic__eyebrow > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c1);
  box-shadow: 0 0 14px var(--c1);
  animation: ka-chromatic-dot 2.4s ease-in-out infinite;
}
.ka-chromatic__eyebrow i { color: #5e5a6b; font-style: normal; }
.ka-chromatic__intro h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(52px, 8vw, 112px);
  font-weight: 500;
  letter-spacing: -.075em;
  line-height: .94;
}
.ka-chromatic__intro h1 em {
  background: linear-gradient(93deg, #14d9ff 2%, #7168ff 32%, #ff37c9 61%, #ffae46 88%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  font-style: normal;
}
.ka-chromatic__lede { margin: 23px 0 0; color: #aaa9b3; font-size: clamp(14px, 1.5vw, 18px); line-height: 1.55; }
.ka-chromatic__intro-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 44px;
  color: #797783;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .17em;
}
.ka-chromatic__intro-foot b { padding-left: 8px; color: var(--c1); font-size: 14px; }

/* ---------- the one animation ---------- */
.ka-chromatic__stage { padding: 40px 1.7% 0; }
.ka-chromatic__frame {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: clamp(290px, 44vw, 580px);
  border: 1px solid color-mix(in srgb, var(--c1), white 24%);
  border-radius: 26px;
  background: radial-gradient(ellipse at 50% 108%, color-mix(in srgb, var(--c1), transparent 88%), transparent 62%), linear-gradient(180deg, #08080d, #050509 100%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c1), transparent 74%), 0 0 40px color-mix(in srgb, var(--c1), transparent 80%), 0 0 90px color-mix(in srgb, var(--c5), transparent 90%), inset 0 0 44px rgba(255, 255, 255, .02);
  transition: border-color .4s ease, box-shadow .4s ease;
}
.ka-chromatic__frame:before {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .16), transparent 30% 72%, rgba(0, 0, 0, .2));
  content: "";
  pointer-events: none;
}
.ka-chromatic__canvas { position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; }
.ka-chromatic__frame-top {
  position: absolute;
  z-index: 2;
  top: 22px;
  right: 26px;
  left: 26px;
  display: flex;
  justify-content: space-between;
  color: rgba(242, 241, 249, .6);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .18em;
}
.ka-chromatic__frame-top > span:first-child i { color: var(--c1); font-style: normal; }
.ka-chromatic__live { display: flex; align-items: center; gap: 7px; color: rgba(240, 240, 246, .72); }
.ka-chromatic__live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c1);
  box-shadow: 0 0 10px var(--c1);
  animation: ka-chromatic-dot 1.8s ease-in-out infinite;
}
.ka-chromatic__art-corner {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 26px;
  color: rgba(255, 255, 255, .26);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  transform: translateY(-50%);
}
.ka-chromatic__art-corner i { padding-left: 6px; color: var(--c1); font-size: 13px; font-style: normal; }
.ka-chromatic__frame-title {
  position: absolute;
  z-index: 2;
  right: 26px;
  bottom: 22px;
  left: 26px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 0;
}
.ka-chromatic__frame-title strong {
  color: #fff;
  font-size: clamp(26px, 4vw, 52px);
  font-weight: 500;
  letter-spacing: -.055em;
  text-shadow: 0 2px 30px #050508;
}
.ka-chromatic__frame-title strong b { padding-left: 3px; color: var(--c1); }
.ka-chromatic__frame-title span {
  padding-bottom: 8px;
  color: rgba(242, 241, 249, .72);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
}
.ka-chromatic__frame-title span i { padding-left: 6px; color: var(--c1); font-style: normal; }

/* ---------- colour picker ---------- */
.ka-chromatic__picker {
  display: grid;
  grid-template-columns: minmax(240px, .85fr) minmax(0, 2fr);
  gap: 32px 48px;
  align-items: start;
  padding: 54px 1.7% 0;
}
.ka-chromatic__picker-head { grid-column: 1; grid-row: 1 / span 2; }
.ka-chromatic__picker-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: #a9a7b4;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .22em;
}
.ka-chromatic__picker-kicker span { width: 7px; height: 7px; border-radius: 50%; background: var(--c1); box-shadow: 0 0 14px var(--c1); }
.ka-chromatic__picker-head h2 { margin: 0; font-size: clamp(28px, 3.4vw, 46px); font-weight: 500; letter-spacing: -.05em; line-height: 1; }
.ka-chromatic__picker-head p:last-child { margin: 15px 0 0; color: var(--ka-chromatic-muted); font-size: 15px; line-height: 1.6; }
.ka-chromatic__presets { grid-column: 2; grid-row: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ka-chromatic__slots { grid-column: 2; grid-row: 2; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.ka-chromatic__preset {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px 15px 13px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 16px;
  background: rgba(255, 255, 255, .03);
  color: #e9e9ef;
  text-align: left;
  cursor: pointer;
  transition: transform .25s ease, border-color .25s ease, background .25s ease, box-shadow .25s ease;
}
.ka-chromatic__preset:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, .34); }
.ka-chromatic__preset[aria-pressed="true"] {
  border-color: var(--c1);
  background: linear-gradient(145deg, color-mix(in srgb, var(--c1), transparent 82%), rgba(255, 255, 255, .02));
  box-shadow: 0 0 26px color-mix(in srgb, var(--c1), transparent 80%);
}
.ka-chromatic__preset-dots { display: flex; gap: 5px; }
.ka-chromatic__preset-dots i { width: 15px; height: 15px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); }
.ka-chromatic__preset-name { font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
.ka-chromatic__preset-mood { color: #7d7c88; font-size: 8px; font-weight: 700; letter-spacing: .16em; }
.ka-chromatic__preset[aria-pressed="true"] .ka-chromatic__preset-mood { color: var(--c1); }

.ka-chromatic__slot { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.ka-chromatic__slot-well {
  position: relative;
  display: block;
  width: clamp(44px, 5vw, 66px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  background: var(--swatch-color);
  box-shadow: 0 0 24px color-mix(in srgb, var(--swatch-color), transparent 62%), inset 0 0 16px rgba(255, 255, 255, .16);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.ka-chromatic__slot-well:after {
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: linear-gradient(145deg, rgba(255, 255, 255, .34), transparent 46%);
  content: "";
  pointer-events: none;
}
.ka-chromatic__slot-well input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  opacity: 0;
}
.ka-chromatic__slot-well:hover { transform: scale(1.06); }
.ka-chromatic__slot-well:focus-within { outline: 2px solid #fff; outline-offset: 5px; }
.ka-chromatic__slot-hex {
  padding: 0;
  border: 0;
  background: none;
  color: #eeeef2;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(9px, 1vw, 12px);
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
}
.ka-chromatic__slot-hex:hover { color: var(--c1); }
.ka-chromatic__slot-hex:focus-visible { outline: 2px solid var(--c1); outline-offset: 4px; }
.ka-chromatic__slot-index { color: #666570; font-size: 7px; letter-spacing: .14em; }
.ka-chromatic__status {
  grid-column: 1 / -1;
  min-height: 15px;
  margin: 6px 0 0;
  color: #6f6e79;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .18em;
  text-align: right;
}

/* ---------- footer ---------- */
.ka-chromatic__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin: 46px auto 0;
  color: #cbcbd2;
  font-size: clamp(10px, 1.4vw, 16px);
  letter-spacing: .15em;
  text-align: center;
}
.ka-chromatic__footer i { padding: 0 9px; color: var(--c1); font-style: normal; }
.ka-chromatic__footer-lines { width: clamp(35px, 9vw, 120px); height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .62)); }
.ka-chromatic__footer-lines:last-child { transform: rotate(180deg); }

@keyframes ka-chromatic-dot {
  0%, 100% { opacity: .62; }
  50% { opacity: 1; }
}

@media (max-width: 980px) {
  .ka-chromatic__picker { grid-template-columns: 1fr; }
  .ka-chromatic__picker-head, .ka-chromatic__presets, .ka-chromatic__slots { grid-column: 1; grid-row: auto; }
  .ka-chromatic__status { text-align: left; }
}
@media (max-width: 760px) {
  .ka-chromatic { width: min(100% - 32px, 620px); padding-top: 24px; }
  .ka-chromatic__intro { min-height: 320px; padding: 55px 1% 25px; }
  .ka-chromatic__brand { top: 15px; left: 1%; }
  .ka-chromatic__intro-foot { margin-top: 32px; }
  .ka-chromatic__stage { padding: 26px 0 0; }
  .ka-chromatic__frame { height: clamp(260px, 62vw, 420px); border-radius: 20px; }
  .ka-chromatic__frame-top, .ka-chromatic__frame-title, .ka-chromatic__art-corner { right: 16px; left: 16px; }
  .ka-chromatic__art-corner { top: auto; bottom: 74px; transform: none; }
  .ka-chromatic__picker { padding: 38px 0 0; }
  .ka-chromatic__presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ka-chromatic__slot-well { width: clamp(42px, 12vw, 58px); }
  .ka-chromatic__footer { gap: 10px; font-size: 9px; letter-spacing: .1em; }
}
@media (max-width: 420px) {
  .ka-chromatic__intro h1 { font-size: 50px; }
  .ka-chromatic__eyebrow { font-size: 8px; }
  .ka-chromatic__intro-foot { font-size: 7px; }
  .ka-chromatic__frame-top { font-size: 7px; }
  .ka-chromatic__slots { gap: 6px; }
  .ka-chromatic__slot-hex { font-size: 9px; }
  .ka-chromatic__footer-lines { width: 25px; }
}
@media (prefers-reduced-motion: reduce) {
  .ka-chromatic__eyebrow > span, .ka-chromatic__live i {
    animation: none !important;
  }
  .ka-chromatic__frame, .ka-chromatic__preset, .ka-chromatic__slot-well, .ka-chromatic__slot-well input { transition: none !important; }
}
