/* ==========================================================================
   Components: buttons, pills, section headings, icon tiles, media, forms
   ========================================================================== */

/* --- Buttons ------------------------------------------------------------ */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 40px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  color: #fff;
  isolation: isolate;
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
  opacity: 0;
  transition: opacity 0.3s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:hover::after {
  opacity: 1;
}

.btn:active {
  transform: translateY(0);
}

.btn--brand {
  background: linear-gradient(90deg, #8a00f0, #7a0cff);
  box-shadow: 0 10px 24px -10px rgba(138, 0, 240, 0.6);
}

.btn--warm {
  background: var(--grad-warm);
  box-shadow: 0 10px 24px -12px rgba(255, 80, 80, 0.7);
}

.btn--ghost {
  color: var(--c-ink);
  background: var(--c-surface);
  border: 1px solid var(--c-line);
}

.btn--sm {
  min-height: 28px;
  padding: 0 14px;
  border-radius: 7px;
  font-size: 0.75rem;
}

.btn--warm:not(.btn--sm) {
  min-height: 42px;
  padding: 0 22px;
  font-size: 1.25rem;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 1.375rem;
  color: var(--c-muted);
  transition: color 0.2s, gap 0.3s var(--ease);
}

.link-arrow .icon {
  width: 16px;
  height: 16px;
}

.link-arrow:hover {
  color: var(--c-ink);
  gap: 12px;
}

/* --- Pills & section heads --------------------------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 32px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.5vw, 1.375rem);
  font-weight: 300;
  letter-spacing: 0;
  line-height: 1;
  color: #fff;
}

.pill--brand {
  background: var(--grad-brand);
}

.pill--warm {
  background: var(--grad-warm);
}

/* When a pill is the section's only heading. */
.pill--heading {
  min-height: 46px;
  padding: 0 28px;
}

.section-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(16px, 2.4vh, 24px);
  margin-bottom: var(--head-gap);
}

.section-head--center {
  align-items: center;
  text-align: center;
}

.section-title {
  font-size: var(--fs-h2);
  line-height: 1.22;
  max-width: 28em;
}

.section-title--md {
  font-size: var(--fs-h2-md);
  max-width: 33em;
}

.section-title--left {
  font-size: clamp(2rem, 3.5vw, 3.3rem);
  max-width: 21em;
  text-wrap: initial;
}

/* --- Icon tiles & bullets ---------------------------------------------- */

.icon-tile {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 6px;
  background: var(--c-surface);
  box-shadow: var(--shadow-sm), 4px 4px 0 -2px rgba(0, 0, 0, 0.04);
  color: var(--c-ink);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), color 0.3s;
}

.icon-tile .icon {
  width: 30px;
  height: 30px;
}

.icon-tile--dark {
  width: 90px;
  height: 90px;
  border-radius: 14px;
  background: linear-gradient(145deg, #2a2125, #121012);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.icon-tile--dark .icon {
  width: 34px;
  height: 34px;
}

.icon--warm {
  color: #ff5a5a;
}

.bullets {
  display: grid;
  gap: 10px;
  font-size: 1rem;
  color: var(--c-ink-soft);
}

.bullets li {
  position: relative;
  padding-left: 24px;
}

.bullets li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-blue);
  box-shadow: 0 0 0 3px rgba(43, 59, 255, 0.12);
}

/* --- Media placeholders -------------------------------------------------
   Every photo/logo sits in a .media box. Until the image file exists the
   box shows a neutral placeholder; main.js reveals the image once it loads.
   ------------------------------------------------------------------------ */

.media {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0)),
    #e7e7ec;
}

.media::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 8px;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s;
}

.media.is-loaded {
  background: none;
}

.media.is-loaded::after {
  content: none;
}

.media.is-loaded > img {
  opacity: 1;
}

/* No JS: show whatever images exist. */
html:not(.js) .media > img {
  opacity: 1;
}

.media--dark {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0)),
    #19171b;
}

.media--dark::after {
  color: rgba(255, 255, 255, 0.28);
}

.media--logo {
  display: grid;
  /* One cell the size of the box, so the logo scales down to fit inside it. */
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  height: 64px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.035);
  border: 1px dashed rgba(0, 0, 0, 0.1);
}

.media--logo > img {
  object-fit: contain;
}

.media--logo.is-loaded {
  border-color: transparent;
}

.media--sm {
  width: 64px;
  height: 56px;
}

.media--xs {
  width: auto;
  min-width: 40px;
  height: 30px;
  padding-inline: 4px;
}

/* The box takes the logo's own width (at the box height), so wide logos keep their shape. */
.media--xs > img {
  width: auto;
  height: 30px;
  max-width: 100%;
}

.media--xs::after,
.media--sm::after {
  font-size: 0.625rem;
}

.media--portrait {
  background: transparent;
}

.media--portrait > img {
  object-fit: contain;
  object-position: bottom center;
}

.media--portrait::after {
  color: rgba(255, 255, 255, 0.5);
}

.media--product {
  background: transparent;
}

.media--product > img {
  object-fit: contain;
}

/* Used by news articles that have no image yet. */
.media--news-empty {
  background:
    radial-gradient(80% 90% at 0% 100%, rgba(255, 122, 0, 0.18), transparent 60%),
    radial-gradient(80% 90% at 100% 0%, rgba(43, 69, 255, 0.2), transparent 60%),
    linear-gradient(135deg, #f1edf8, #e9e7f3);
}

.media--news-empty::after {
  content: '';
  inset: 50% auto auto 50%;
  width: 34%;
  max-width: 120px;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: url('/assets/images/logo-mark.png') center / contain no-repeat;
  opacity: 0.35;
}

/* --- Form fields -------------------------------------------------------- */

.field {
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  background: var(--c-surface);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field:focus {
  outline: none;
  border-color: var(--c-violet);
  box-shadow: 0 0 0 4px rgba(91, 43, 255, 0.12);
}
