/* Rounded, tactile controls shared by the store, the order page and the
   merchant panel: pill buttons with a chrome edge on hover, rounded fields,
   pill category filters. Loaded right after each page's main stylesheet.
   Tokens: base.css. */

:root {
  --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-premium: 0.25s;
  --chrome-edge: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1px 0 rgba(0, 0, 0, 0.35);
  --chrome-glow: 0 10px 26px -14px rgba(244, 241, 236, 0.45);
}

/* ---------- Buttons ---------- */

.btn,
.pill,
.hero__cta {
  border-radius: var(--radius-pill);
  transition:
    transform var(--dur-premium) var(--ease-premium),
    box-shadow var(--dur-premium) var(--ease-premium),
    background-color var(--dur-premium) var(--ease-premium),
    border-color var(--dur-premium) var(--ease-premium),
    color var(--dur-premium) var(--ease-premium),
    opacity var(--dur-premium) var(--ease-premium);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--chrome-edge), var(--chrome-glow);
}

/* Primary: a polished silver face rather than a flat fill. */
.btn--primary {
  background: linear-gradient(180deg, #ffffff 0%, var(--text) 45%, #cfc9c0 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -1px 0 rgba(0, 0, 0, 0.18);
}

.btn--primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffffff 0%, #f7f4ef 50%, #ddd8d0 100%);
  box-shadow: inset 0 1px 0 #ffffff, inset 0 -1px 0 rgba(0, 0, 0, 0.18), 0 12px 30px -12px rgba(244, 241, 236, 0.55);
}

.btn:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
  transition-duration: 0.1s;
}

.btn:focus-visible,
.pill:focus-visible,
.hero__cta:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

/* Hero call to action: an outlined pill (it was an underlined word). */
.hero__cta {
  display: inline-flex;
  align-items: center;
  min-height: 54px;
  padding: 0 36px;
  font-size: 0.75rem;
  border: 1px solid var(--border-strong);
  letter-spacing: var(--tracking-wider);
}

.hero__cta:hover {
  border-color: var(--text);
  background-color: rgba(244, 241, 236, 0.06);
  letter-spacing: var(--tracking-wider);
  transform: translateY(-1px);
  box-shadow: var(--chrome-edge), var(--chrome-glow);
}

/* ---------- Category filters: pill chips, the active one in silver ---------- */

.filters { gap: var(--space-2); align-items: center; }

.filters .pill {
  min-height: 40px;
  padding: 7px 14px;
  letter-spacing: 0.1em;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--muted);
}

.filters .pill::after { display: none; }

.filters .pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.filters .pill[aria-pressed='true'] {
  border-color: transparent;
  background: linear-gradient(180deg, #ffffff 0%, var(--text) 45%, #cfc9c0 100%);
  color: var(--bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), var(--chrome-glow);
}

@media (min-width: 900px) {
  .filters { row-gap: var(--space-2); }
}

/* ---------- Hero: logo and tagline closer now that the title is visually hidden ---------- */

.hero__logo { margin-bottom: -36px; }
@media (min-width: 768px) {
  .hero__logo { margin-bottom: -56px; }
}

/* The copy wrapper is what scroll-fx.js moves, so the load-time fade-up on
   the elements inside is never touched. */
.hero__mark,
.hero__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Scroll: header state and progress line ---------- */

.site-header {
  transition: background-color 0.4s var(--ease-premium), box-shadow 0.4s var(--ease-premium), border-color 0.4s var(--ease-premium);
}

.site-header.is-scrolled {
  border-bottom-color: rgba(244, 241, 236, 0.08);
  background-color: rgba(19, 18, 17, 0.94);
  box-shadow: 0 12px 32px -20px rgba(0, 0, 0, 0.9);
}

.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 51;
  height: 1px;
  background: linear-gradient(90deg, rgba(244, 241, 236, 0.15), #f4f1ec 60%, #ffffff);
  box-shadow: 0 0 8px rgba(244, 241, 236, 0.35);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* ---------- Fields ---------- */

.co-field__input,
.input {
  border-radius: 12px;
}

/* ---------- Motion preferences ---------- */

/* Blocks revealed by Motion (motion-fx.js) skip the CSS fade. */
html.js .reveal.is-motion { transition: none; }

/* Magnetic buttons move with the CSS `translate` property (motion-fx.js), so
   it never fights the hover lift above, which uses `transform`. */
@media (prefers-reduced-motion: reduce) {
  .btn:hover:not(:disabled),
  .hero__cta:hover,
  .filters .pill:hover {
    transform: none;
  }
}

/* ---------- Animated search field (animated-input.js) ---------- */

.ai { position: relative; display: block; flex: 1 1 auto; min-width: 0; }

/* The native input keeps working underneath; its own ink is hidden only once
   the animated layer is in place. */
.ai.is-ready > input { color: transparent; caret-color: transparent; }
.ai.is-ready > input::placeholder { color: transparent; opacity: 0; }
.ai > input::selection { background: rgba(244, 241, 236, 0.26); color: transparent; }

.ai__layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: var(--text);
  white-space: pre;
  pointer-events: none;
}

.ai__track { position: relative; display: inline-flex; align-items: center; }
.ai__text { position: relative; display: inline-flex; }
.ai__placeholder { color: var(--muted); }
.ai:not(.is-empty) .ai__placeholder { display: none; }

.ai__char { display: inline-block; white-space: pre; }
.ai__char.is-entering { animation: ai-in 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.ai__char.is-leaving { position: absolute; top: 0; animation: ai-out 0.16s ease-out forwards; }

@keyframes ai-in {
  from { opacity: 0; transform: translateY(6px) scale(0.85); filter: blur(2px); }
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes ai-out {
  to { opacity: 0; transform: translateY(-4px) scale(0.9); }
}

/* Silver caret with a soft halo; solid while typing, blinking at rest. */
.ai__caret {
  position: absolute;
  top: 50%;
  left: 0;
  width: 1.5px;
  height: 1.15em;
  margin-top: -0.575em;
  border-radius: 2px;
  background: #f4f1ec;
  box-shadow: 0 0 6px 1px rgba(244, 241, 236, 0.5), 0 0 14px rgba(244, 241, 236, 0.22);
  opacity: 0;
  transition: transform 0.12s var(--ease-premium);
}

.ai.is-focused .ai__caret,
.ai.is-demo .ai__caret { opacity: 1; animation: ai-blink 1.06s steps(1) infinite; }
.ai.is-typing .ai__caret { animation: none; opacity: 1; }
.ai.has-selection .ai__caret { opacity: 0; animation: none; }
.ai.is-demo .ai__caret { opacity: 0.6; }

@keyframes ai-blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .ai__char.is-entering,
  .ai__char.is-leaving { animation: none; }
  .ai__caret { transition: none; }
}
