/* -----------------------------
   Design tokens (CSS variables)
--------------------------------*/
:root {
  --bg: #0c0816;
  --panel: #110c1b;
  --border: rgba(156, 129, 205, 0.25);
  --text: #e7e3f5;
  --muted: #a29abb;
  --input-pad-x: 16px;
  --input-pad-y: 14px;
  --acc1: #40ffaa; /* accent A */
  --acc2: #4079ff; /* accent B */
  --input-h: 50px;
  --purple: #6c57d6;  /* shared highlight */

  /* Shimmer knobs */
  --shimmer-speed: 6s;
  --shimmer-color-top: var(--acc1);
  --shimmer-color-bottom: var(--acc2);
  --shimmer-gap: .20s;
}

/* Base reset-ish */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  min-height: 100svh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Center the main content vertically a bit lower */
  padding: 24px;
}

.shell {
  width: min(960px, 100%);
  margin-inline: auto;
}

/* Row that holds the input and the button */
.bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 800px;
  margin: 20vh auto 28px;
}

/* Make the left side flex to consume free space */
.shimmerWrap {
  display: flex; /* so .inputWrap can flex */
  flex: 1 1 auto;
  min-width: 0;
}

/* Container that clips the shimmer and holds the input */
.inputWrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0; /* prevents overflow in flex rows */
  width: 100%; /* fill the shimmerWrap */
  height: calc(var(--input-h) + 4px); /* includes outer container padding (2px top+bottom) */
}

/* Actual input element */
.input {
  width: 100%;
  height: 100%;
  padding: var(--input-pad-y) var(--input-pad-x);
  font: 400 16px/20px inherit;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px; /* outer 16px minus 2px container padding */
  outline: none;
  transition: box-shadow .2s ease, border-color .2s ease;
  font-kerning: none;
  text-rendering: geometricPrecision;
}

.input::placeholder {
  color: #8b86a3;
}

.input:focus {
  border-color: #6c57d6;
  box-shadow: 0 0 0 6px rgba(108, 87, 214, .12);
}

.input.animating {
  caret-color: transparent;
}

.input:active {
  border-color: var(--purple);
  box-shadow: 0 0 0 6px rgba(108,87,214,.18);
}

/* Button */
.btn {
  flex-shrink: 0;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  background: linear-gradient(90deg, var(--acc2), var(--acc1));
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  transition: transform .06s ease, box-shadow .2s ease, filter .2s ease;
  box-shadow: 0 8px 24px rgba(64,121,255,.18);
  white-space: nowrap;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn:active {
  transform: translateY(1px);
}

/* Placeholder animation scaffolding (GSAP uses spans) */
.placeholderAnim {
  position: absolute;
  top: 50%;
  left: 0px;
  right: 16px;
  transform: translateY(-50%);
  pointer-events: none;
  font: inherit;
  line-height: 20px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.placeholderAnim .char {
  display: inline-block;
  background: linear-gradient(90deg, var(--acc1), var(--acc2), var(--acc1));
  background-size: 300% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  animation: gradientShift 3s linear infinite;
  font-kerning: none;
}

.placeholderAnim .sp {
  display: inline-block;
  white-space: pre;
}

/* Card for results */
.card {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
}

/* Vertical stack for cards */
.stack {
  width: min(720px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 16px; /* spacing between cards */
}

/* Optional: tidy metric text */
.metrics {
  display: grid;
  gap: 8px;
  line-height: 1.35;
}
.metrics b {
  font-weight: 600;
}


.hidden {
  display: none;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

code {
  background: rgba(255,255,255,.06);
  padding: 2px 6px;
  border-radius: 6px;
}

/* Consistent text rendering choices */
.input,
.input::placeholder,
.placeholderAnim,
.placeholderAnim .char,
.placeholderAnim .sp {
  font-variant-ligatures: none;
  font-kerning: none;
}

/* Gradient placeholder (when used) */
.input.gradientPlaceholder::placeholder {
  background: linear-gradient(90deg, var(--acc1), var(--acc2), var(--acc1), var(--acc2), var(--acc1));
  background-size: 300% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 6s linear infinite;
}

/* Positioning context for input and placeholder overlay */
.inputContainer {
  position: relative;
  z-index: 2; /* above shimmer */
  width: 100%;
  height: 100%;
}

/* The animated placeholder line shown before typing */
.animatedPlaceholder {
  position: absolute;
  top: 50%;
  left: calc(var(--input-pad-x) + 2px);
  right: var(--input-pad-x);
  transform: translateY(-50%);
  pointer-events: none;
  font: inherit;
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  background: linear-gradient(90deg, #40ffaa, #4079ff, #40ffaa, #4079ff, #40ffaa);
  background-size: 300% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientWave 6s ease-in-out infinite;
  transition: opacity .2s ease;
}

/* Hide the overlay once the native placeholder is no longer shown */
.input:not(:placeholder-shown) + .animatedPlaceholder {
  opacity: 0;
}

.animatedPlaceholder .char {
  display: inline-block;
  background: linear-gradient(90deg, var(--acc1), var(--acc2), var(--acc1));
  background-size: 300% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  animation: gradientWave 6s ease-in-out infinite;
  font-kerning: none;
}

.animatedPlaceholder .sp {
  display: inline-block;
  white-space: pre;
}

/* -----------------------------
   Star-border shimmer (thin sweep)
--------------------------------*/
.star-border-container {
  position: relative;
  overflow: hidden; /* clip the sweeps */
  border-radius: 16px;
  padding: 1px; /* thin ring for the glow to show through */
  background: transparent;
}

/* Sweeping radial gradients (hidden until .shimmer is present) */
.star-border-container .border-gradient-top,
.star-border-container .border-gradient-bottom {
  position: absolute;
  z-index: 1; /* under content, above container bg */
  display: none;
  pointer-events: none;
  border-radius: 50%;
  width: 300%;
  height: 50%;
  opacity: .7;
}

.star-border-container .border-gradient-top.second,
.star-border-container .border-gradient-bottom.second {
  /* same base geometry & z-index as the first pair; only timing/opacity differ */
  animation-delay: var(--shimmer-gap);
  opacity: .55; /* a touch softer than the lead shimmer */
}

/* Top sweep: left -> right */
.star-border-container .border-gradient-top {
  top: -12px;
  left: -250%;
  background: radial-gradient(circle, var(--acc2), transparent 10%);
  animation: star-movement-top var(--shimmer-speed) linear infinite alternate;
}

/* Bottom sweep: right -> left */
.star-border-container .border-gradient-bottom {
  bottom: -12px;
  right: -250%;
  background: radial-gradient(circle, var(--acc1), transparent 10%);
  animation: star-movement-bottom var(--shimmer-speed) linear infinite alternate;
}

/* Toggle shimmer visibility */
.star-border-container.shimmer .border-gradient-top,
.star-border-container.shimmer .border-gradient-bottom,
.star-border-container.shimmer .border-gradient-top.second,
.star-border-container.shimmer .border-gradient-bottom.second {
  display: block;
}

/* -----------------------------
   Keyframes
--------------------------------*/
@keyframes gradientWave {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes star-movement-top {
  0%   { transform: translate(0%, 0%); opacity: 1; }
  100% { transform: translate(100%, 0%); opacity: 0; }
}

@keyframes star-movement-bottom {
  0%   { transform: translate(0%, 0%); opacity: 1; }
  100% { transform: translate(-100%, 0%); opacity: 0; }
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .shimmerWrap .border-gradient-top,
  .shimmerWrap .border-gradient-bottom {
    animation: none;
    opacity: .25;
  }
}

/* -----------------------------
   Navigation (not part of the core effect)
--------------------------------*/
/* ---- horizontal Dock (Step 1: static) ---- */
:root {
  --dock-w: 68px;       /* dock panel width */
  --dock-pad: 10px;     /* inner padding of panel */
  --dock-item: 50px;    /* base size of each button */
  --dock-magnify: 70px; /* max size on hover (like magnification) */
  --dock-gap: 15px;     /* space between buttons */
  --dock-radius: 16px;
  --dock-top: 12px;     /* distance from top edge */
}

body.with-dock {
  padding-left: 24px;
} /* back to normal page padding */

.side-dock {
  position: fixed;
  z-index: 1000;
  top: var(--dock-top);
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  /* invisible container */
  background: transparent;
  border: 0;
  padding: 6px 8px; /* small hit area; tweak if you like */
}

.dock-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  align-items: flex-end; /* lets the bigger button grow upward a bit */
  gap: var(--dock-gap);
}

/* Buttons grow via a CSS variable --size that JS updates */
.dock-btn{
  position: relative;
  width: calc(var(--size) * 2);
  height: var(--size);
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0b0714;
  color: var(--text);
  cursor: pointer;
  outline: none;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,.25), 0 2px 4px -1px rgba(0,0,0,.18);
  transition: width .12s ease, height .12s ease, transform .12s ease, filter .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.dock-btn:hover {
  filter: brightness(1.04);
  border-color: var(--purple);
  box-shadow: 0 0 0 6px rgba(108,87,214,.18), 0 4px 6px -1px rgba(0,0,0,.25), 0 2px 4px -1px rgba(0,0,0,.18);
}

.dock-btn:active {
  transform: translateY(1px);
  border-color: var(--purple);
  box-shadow: 0 0 0 6px rgba(108,87,214,.22)
}

.dock-btn:focus-visible{
  border-color: var(--purple);
  box-shadow:0 0 0 6px rgba(108,87,214,.18);
}

.dock-icon{
  width: 50%;
  height: 100%;
  display: grid;
  place-items: center;
}

/* SVG scales with the button */
.dock-icon svg{
  width: 58%;
  height: 58%;
}

/* Tooltip label shows BELOW the icon (top dock) */
.dock-label{
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(-2px);
  opacity: 0;
  pointer-events: none;
  background: #060010;
  border: 1px solid var(--border);
  color: #fff;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  transition: opacity .18s ease, transform .18s ease;
}

.dock-btn:hover .dock-label,
.dock-btn:focus-visible .dock-label,
.dock-btn:active .dock-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

