/**
 * Kinetic and signature layer.
 *
 * The visual vocabulary comes from the product: liquid filling a can,
 * carbonation, brushed aluminium, inkjet batch codes, and a line that indexes
 * forward. Paired with assets/js/kinetic.js.
 *
 * @package Koladiya_Theme
 */

/* ============================================================
   WORD-BY-WORD HEADLINE RISE
   ============================================================ */
.kw {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  line-height: inherit;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}

.kw > span {
  display: inline-block;
  transform: translateY(108%);
  transition: transform 760ms var(--ki-ease-apple);
}

.is-lit .kw > span { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .kw > span { transform: none !important; transition: none; }
}

/* ============================================================
   CARBONATION CANVAS
   ============================================================ */
.ki-bubbles,
.ki-cine > canvas.ki-bubbles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   CINEMATIC BAND  — full-bleed dark, image behind, bubbles over
   ============================================================ */
.ki-cine {
  position: relative;
  isolation: isolate;
  background: var(--ki-black);
  color: var(--ki-g300);
  overflow: hidden;
  padding: clamp(56px, 8vw, 104px) 0;
}

.ki-cine-bg {
  position: absolute;
  inset: -8% 0;
  z-index: -2;
}

.ki-cine-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.34;
  filter: grayscale(0.35) contrast(1.08);
}

.ki-cine::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(90% 70% at 18% 20%, rgba(10, 52, 127, 0.55), transparent 62%),
    linear-gradient(180deg, rgba(4, 5, 6, 0.86) 0%, rgba(4, 5, 6, 0.6) 45%, rgba(4, 5, 6, 0.95) 100%);
}

.ki-cine > :not(.ki-bubbles):not(.ki-cine-bg) { position: relative; z-index: 1; }

.ki-cine h2,
.ki-cine blockquote {
  margin: 0;
  font-family: var(--ki-font-heading);
  font-size: clamp(20px, 2.3vw, 29px);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.035em;
  color: #FFFFFF;
  max-width: 28ch;
}

.ki-cine em {
  font-style: normal;
  background: var(--ki-gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ki-cine .ki-p { color: rgba(255, 255, 255, 0.62); margin-top: 18px; max-width: 54ch; }
.ki-cine .ki-eyebrow { color: var(--ki-blue-cyan); }

.ki-cine-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  margin-top: 34px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

/* ============================================================
   CAN GAUGE  — a slim-can silhouette that fills as you read
   ============================================================ */
.ki-can {
  --fill: 0;
  position: relative;
  width: 86px;
  height: 172px;
  flex-shrink: 0;
  border-radius: 11px / 16px;
  background:
    linear-gradient(90deg,
      rgba(0, 0, 0, 0.34) 0%,
      rgba(255, 255, 255, 0.10) 16%,
      rgba(255, 255, 255, 0.42) 34%,
      rgba(255, 255, 255, 0.08) 56%,
      rgba(0, 0, 0, 0.30) 100%),
    linear-gradient(180deg, #C3CAD6, #8D97A8 42%, #6C7688);
  box-shadow:
    inset 0 5px 0 rgba(255, 255, 255, 0.34),
    inset 0 -5px 0 rgba(0, 0, 0, 0.26),
    0 18px 34px -14px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.ki-can::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--fill) * 100%);
  background: linear-gradient(180deg, var(--can-liquid-top, #2563EB), var(--can-liquid, #0A347F));
  transition: height 420ms var(--ki-ease-apple);
}

/* the meniscus */
.ki-can::after {
  content: "";
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: calc(var(--fill) * 100%);
  height: 7px;
  margin-bottom: -3px;
  border-radius: 50%;
  background: var(--can-liquid-top, #2563EB);
  filter: brightness(1.32);
  opacity: calc(var(--fill) * 1);
  transition: bottom 420ms var(--ki-ease-apple), opacity 300ms ease;
}

.ki-can-label {
  position: absolute;
  inset: auto 0 10px;
  text-align: center;
  font-family: var(--ki-font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.85);
  z-index: 2;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.ki-gauge {
  display: flex;
  align-items: flex-start;
  gap: 26px;
}

.ki-gauge-read { display: flex; flex-direction: column; gap: 3px; }

.ki-gauge-v {
  font-family: var(--ki-font-heading);
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  color: #FFFFFF;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   PRODUCTION LINE  — sticky stage, track travels on scroll
   ============================================================ */
.ki-line-shell { position: relative; }

.ki-line-stage {
  position: sticky;
  top: var(--headroom);
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  background: var(--ki-black);
  color: var(--ki-g300);
}

.ki-line-stage.is-static { position: static; height: auto; padding: var(--sec-y) 0; }

.ki-line-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--gutter) 22px;
  max-width: var(--wide);
  margin: 0 auto;
  width: 100%;
}

.ki-line-head h2 {
  font-family: var(--ki-font-heading);
  font-size: clamp(19px, 2.1vw, 26px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #FFFFFF;
}

.ki-line-rail {
  display: flex;
  gap: 16px;
  padding: 0 var(--gutter);
  will-change: transform;
}

.ki-line-card {
  position: relative;
  flex: 0 0 300px;
  padding: 22px;
  border-radius: var(--ki-card-radius);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  overflow: hidden;
  transition: border-color 420ms ease, background 420ms ease, transform 420ms var(--ki-ease-apple);
}

.ki-line-card.is-on {
  background: rgba(37, 99, 235, 0.14);
  border-color: rgba(56, 189, 248, 0.5);
  transform: translateY(-5px);
}

.ki-line-card h3 {
  margin: 12px 0 7px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #FFFFFF;
}

.ki-line-card p { font-size: 13.5px; line-height: 1.6; color: rgba(255, 255, 255, 0.62); }

.ki-line-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-family: var(--ki-font-mono);
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
  transition: background 420ms ease, color 420ms ease, border-color 420ms ease;
}

.ki-line-card.is-on .ki-line-n {
  background: var(--ki-blue-cyan);
  border-color: var(--ki-blue-cyan);
  color: #04121A;
}

.ki-line-progress {
  position: relative;
  height: 2px;
  margin: 26px auto 0;
  width: calc(100% - var(--gutter) * 2);
  max-width: var(--wide);
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.ki-line-progress i {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--ki-blue), var(--ki-blue-cyan));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ============================================================
   FLAVOUR WALL  — ingredient colour, not house blue
   ============================================================ */
.ki-fw { display: grid; grid-template-columns: 1fr; gap: 12px; }

.ki-fw-card {
  --f: #2563EB;
  --f-deep: #0A347F;
  --f-ink: #FFFFFF;
  position: relative;
  padding: 18px;
  border-radius: var(--ki-card-radius);
  background: #FFFFFF;
  border: 1px solid var(--ki-border-light);
  box-shadow: var(--ki-shadow-card);
  overflow: hidden;
  transition: transform 300ms var(--ki-ease-apple), box-shadow 300ms ease, border-color 300ms ease;
}

/* pointer-lit wash in the family's own colour */
.ki-fw-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--f) 22%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 340ms ease;
  pointer-events: none;
}

.ki-fw-card:hover { transform: translateY(-4px); box-shadow: var(--ki-shadow-card-hover); border-color: color-mix(in srgb, var(--f) 55%, transparent); }
.ki-fw-card:hover::before { opacity: 1; }

.ki-fw-card > * { position: relative; }

.ki-fw-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--ki-border-light);
}

.ki-fw-swatch {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  flex-shrink: 0;
  background: linear-gradient(145deg, var(--f), var(--f-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 3px 8px -2px color-mix(in srgb, var(--f) 60%, transparent);
}

.ki-fw-head h3 { font-size: 14px; font-weight: 700; letter-spacing: -0.02em; flex: 1; }

.ki-fw-hint { margin: 0 0 14px; font-size: 13px; color: var(--ki-g500); }

/* Family names and entries choose themselves in the can designer. */
.ki-pick {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.ki-fw-head .ki-pick:hover { color: var(--f-deep); text-decoration: underline; text-underline-offset: 3px; }
.ki-fw-list li:has(.ki-pick) { padding: 0; }
.ki-fw-list .ki-pick { display: block; padding: 4px 10px; border-radius: inherit; }
.ki-pick:focus-visible { outline: 2px solid var(--f-deep); outline-offset: 2px; border-radius: 6px; }

.ki-fw-count {
  font-family: var(--ki-font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ki-g400);
}

.ki-fw-list { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; padding: 0; list-style: none; }

.ki-fw-list li {
  padding: 4px 10px;
  border-radius: var(--ki-radius-pill);
  background: color-mix(in srgb, var(--f) 12%, #FFFFFF);
  color: color-mix(in srgb, var(--f-deep) 86%, #000000);
  border: 1px solid color-mix(in srgb, var(--f) 26%, transparent);
  font-size: 11.5px;
  line-height: 1.4;
  transition: background 200ms ease, color 200ms ease, transform 220ms var(--ki-ease-apple);
}

.ki-fw-list li:hover {
  background: linear-gradient(145deg, var(--f), var(--f-deep));
  color: var(--f-ink);
  transform: translateY(-2px);
}

/* ============================================================
   FLAVOUR TICKER
   ============================================================ */
.ki-ticker {
  position: relative;
  overflow: hidden;
  padding: 11px 0;
  border-block: 1px solid var(--ki-border-light);
  background: var(--ki-g50);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

.ki-ticker-rail {
  display: flex;
  gap: 10px;
  width: max-content;
  animation: ki-tick 58s linear infinite;
}

.ki-ticker:hover .ki-ticker-rail { animation-play-state: paused; }

.ki-ticker span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: var(--ki-radius-pill);
  background: #FFFFFF;
  border: 1px solid var(--ki-border-light);
  font-family: var(--ki-font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ki-g600);
  white-space: nowrap;
}

.ki-ticker span i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--d, var(--ki-blue-bright));
  flex-shrink: 0;
}

@keyframes ki-tick {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .ki-ticker-rail { animation: none; }
}

/* ============================================================
   BATCH CODE PLATE
   ============================================================ */
.ki-code {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 13px;
  border-radius: 4px;
  background: #0B0D11;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-family: var(--ki-font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #6EE7F9;
  text-transform: uppercase;
}

.ki-code::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34D399;
  box-shadow: 0 0 9px #34D399;
  animation: ki-blip 2.2s ease-in-out infinite;
}

@keyframes ki-blip { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

@media (prefers-reduced-motion: reduce) {
  .ki-code::before { animation: none; }
}

/* ============================================================
   ALUMINIUM SHEEN SWEEP
   ============================================================ */
.ki-sheen { position: relative; overflow: hidden; }

.ki-sheen::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -70%;
  width: 45%;
  height: 220%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: rotate(14deg);
  transition: left 900ms var(--ki-ease-apple);
  pointer-events: none;
}

.ki-sheen:hover::after { left: 130%; }

@media (prefers-reduced-motion: reduce) {
  .ki-sheen::after { display: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 760px) {
  .ki-fw { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1040px) {
  .ki-fw { grid-template-columns: repeat(3, 1fr); }
  .ki-line-card { flex: 0 0 330px; }
}

/* The statement block sits beside the gauge without colliding with the body copy. */
.ki-gauge-read { padding-top: 2px; }
.ki-cine blockquote,
.ki-cine h2 { overflow: visible; }
.ki-gauge + [data-reveal] { margin-top: 22px; }
@media (max-width: 599px) {
  .ki-gauge { gap: 16px; }
  .ki-can { width: 62px; height: 124px; }
}
