/*
 * Kovalent brand layer on top of Bulma.
 *
 * Ported from the kovalent.systems website stylesheet so the portal shares
 * its tokens, type, buttons and forms. Marketing-only components (hero,
 * mega menu, case studies, footer etc.) are intentionally left out. Keep the
 * values in sync with the website when the brand changes.
 *
 * Palette (kovalent-branding/colours.txt):
 *   orange    #F26419  core
 *   amber     #F6AE2D  accent
 *   slate     #2F4858  contrast
 *   blue      #33658A  accent 2
 *   cyan      #55DDE0  highlight
 *   ink       #161616  backgrounds
 */

:root {
  --kv-orange: #F26419;
  --kv-amber: #F6AE2D;
  --kv-slate: #2F4858;
  --kv-blue: #33658A;
  --kv-cyan: #55DDE0;
  --kv-ink: #161616;
  --kv-white: #ffffff;
  --kv-mist: #d5dde1;
  --kv-muted: #9aa8b0;
  --kv-rule: 2px solid var(--kv-white);
  --kv-heading-family: Funnel Display, system-ui, -apple-system, Segoe UI, Helvetica, Arial, sans-serif;
  --kv-heading-weight: 600;
  --kv-heading-tracking: 0.6;
}

html[data-theme="dark"] {
  --bulma-family-primary: Inter, system-ui, -apple-system, Segoe UI, Helvetica, Arial, sans-serif;
  --bulma-body-family: Inter, system-ui, -apple-system, Segoe UI, Helvetica, Arial, sans-serif;
  --bulma-body-background-color: #161616;
  --bulma-body-color: #ffffff;
  --bulma-body-weight: 400;
  --bulma-body-line-height: 1.5;
  --bulma-text-strong: #ffffff;
  --bulma-weight-normal: 400;
  --bulma-weight-medium: 500;
  --bulma-weight-semibold: 600;
  --bulma-weight-bold: 800;
  --bulma-radius-small: 0;
  --bulma-radius: 0;
  --bulma-radius-medium: 0;
  --bulma-radius-large: 0;
  --bulma-radius-rounded: 0;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@font-face {
  font-family: 'Funnel Display';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/funnel-display/funnel-display-latin.fdffe09288ef.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter/inter-latin.260c81a4759b.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter/inter-latin-italic.0a81fe197e0d.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

body {
  background-color: var(--kv-ink);
  color: var(--kv-white);
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--kv-amber);
}

:focus-visible {
  outline: 2px solid var(--kv-cyan);
  outline-offset: 2px;
}

.kv-skip {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 100;
  padding: .75rem 1rem;
  background-color: var(--kv-amber);
  color: var(--kv-ink);
  font-weight: 600;
}

.kv-skip:focus {
  top: 1rem;
  color: var(--kv-ink);
}


/* Colour helpers */

.has-text-amber { color: var(--kv-amber) !important; }
.has-text-cyan { color: var(--kv-cyan) !important; }
.has-text-orange { color: var(--kv-orange) !important; }
.has-text-mist { color: var(--kv-mist) !important; }
.has-text-muted { color: var(--kv-muted) !important; }


/* Type */

.kv-eyebrow,
.kv-tag {
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kv-tag {
  font-size: .8125rem;
}

.kv-h1,
.kv-h2,
.kv-h3,
.kv-h4 {
  font-family: var(--kv-heading-family);
  font-weight: var(--kv-heading-weight);
}

.kv-h1 {
  font-size: clamp(2.25rem, 4.4vw, 3.5rem);
  letter-spacing: calc(-0.035em * var(--kv-heading-tracking));
  line-height: 1;
}

.kv-h2 {
  font-size: clamp(1.875rem, 3.2vw, 2.5rem);
  letter-spacing: calc(-0.03em * var(--kv-heading-tracking));
  line-height: 1.05;
}

.kv-h3 {
  font-size: clamp(1.5rem, 2.4vw, 1.875rem);
  letter-spacing: calc(-0.02em * var(--kv-heading-tracking));
  line-height: 1.15;
}

.kv-h4 {
  font-size: 1.25rem;
  letter-spacing: calc(-0.015em * var(--kv-heading-tracking));
  line-height: 1.15;
}

.kv-eyebrow + .kv-h1,
.kv-eyebrow + .kv-h2 {
  margin-top: .75rem;
}

.kv-lede {
  max-width: 40rem;
  font-size: 1.25rem;
  line-height: 1.5;
}

.kv-balance {
  text-wrap: balance;
}


/* Icons and arrows */

.kv-icon {
  display: block;
  flex: none;
}

.kv-arrow {
  display: block;
  flex: none;
  transition: transform .15s ease;
}

@media (prefers-reduced-motion: reduce) {
  .kv-arrow { transition: none; }
}


/* Buttons */

.button.kv-button {
  height: auto;
  padding: 1.125rem 1.25rem;
  border: 0;
  border-radius: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: normal;
  box-shadow: none;
}

.button.kv-button.is-amber {
  background-color: var(--kv-amber);
  color: var(--kv-ink);
}

.button.kv-button.is-amber:hover,
.button.kv-button.is-amber:focus-visible {
  background-color: var(--kv-cyan);
  color: var(--kv-ink);
}

.button.kv-button.is-ink {
  background-color: var(--kv-ink);
  color: var(--kv-white);
}

.button.kv-button.is-ink:hover,
.button.kv-button.is-ink:focus-visible {
  background-color: var(--kv-blue);
  color: var(--kv-white);
}

.button.kv-button.is-outline {
  padding: calc(1.125rem - 2px) 1.5rem;
  border: 2px solid var(--kv-white);
  background-color: transparent;
  color: var(--kv-white);
}

.button.kv-button.is-outline:hover,
.button.kv-button.is-outline:focus-visible {
  border-color: var(--kv-cyan);
  color: var(--kv-cyan);
}

.button.kv-button.is-small {
  padding: .625rem 1rem;
  font-size: .9375rem;
}

.button.kv-button.is-small.is-outline {
  padding: calc(.625rem - 2px) 1rem;
}

.button.kv-button.has-arrow {
  justify-content: space-between;
  gap: 1rem;
}

.button.kv-button.has-arrow .kv-arrow {
  width: 1.25em;
  height: 1.25em;
}

.button.kv-button.has-arrow:hover .kv-arrow,
.button.kv-button.has-arrow:focus-visible .kv-arrow {
  transform: translateX(0.25rem);
}


/* Forms */

.kv-form .field:not(:last-child) {
  margin-bottom: 1.75rem;
}

.kv-form .label {
  margin-bottom: .5rem;
  color: var(--kv-white);
  font-size: .9375rem;
  font-weight: 600;
}

.kv-form .input,
.kv-form .textarea,
.kv-form .select select {
  height: auto;
  padding: .875rem 1rem;
  border: 2px solid var(--kv-white);
  border-radius: 0;
  background-color: var(--kv-ink);
  color: var(--kv-white);
  font-size: 1.0625rem;
  box-shadow: none;
}

.kv-form .input:hover,
.kv-form .textarea:hover,
.kv-form .select select:hover {
  border-color: var(--kv-white);
}

.kv-form .input:focus,
.kv-form .input:focus-visible,
.kv-form .textarea:focus,
.kv-form .textarea:focus-visible,
.kv-form .select select:focus,
.kv-form .select select:focus-visible {
  border-color: var(--kv-cyan);
  outline: none;
  box-shadow: 0 0 0 2px var(--kv-cyan);
}

.kv-form .input.is-danger,
.kv-form .textarea.is-danger {
  border-color: var(--kv-orange);
}

.kv-form .textarea {
  line-height: 1.5;
  resize: vertical;
}

.kv-form .kv-help {
  margin-top: .5rem;
  color: var(--kv-muted);
  font-size: .875rem;
  line-height: 1.5;
}

.kv-form .kv-error {
  margin-top: .5rem;
  color: var(--kv-orange);
  font-size: .875rem;
  font-weight: 600;
}


/* Panels and notices */

.kv-panel {
  display: grid;
  gap: 1.5rem;
  padding: 1.75rem 1.5rem 2rem;
  background-color: var(--kv-slate);
}

@media screen and (min-width: 769px) {
  .kv-panel { padding: 2.25rem 2.25rem 2.5rem; }
}

.kv-panel.is-accented {
  border-top: 4px solid var(--kv-orange);
}

.kv-notice {
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--kv-cyan);
  background-color: var(--kv-ink);
  font-size: .9375rem;
  line-height: 1.5;
}

.kv-notice.is-success { border-left-color: var(--kv-cyan); }
.kv-notice.is-info { border-left-color: var(--kv-blue); }
.kv-notice.is-warning { border-left-color: var(--kv-amber); }
.kv-notice.is-error,
.kv-notice.is-danger { border-left-color: var(--kv-orange); }

.kv-notices {
  display: grid;
  gap: .75rem;
}


/* Logo, with the website's hover animation: the mark flies apart and
   reassembles in the website colours (driven by kovalent.js). */

.kv-logo {
  display: inline-flex;
  align-items: center;
  color: var(--kv-white);
}

.kv-logo:hover,
.kv-logo:focus-visible {
  color: var(--kv-white);
}

.kv-logo-svg {
  display: block;
  height: 2.25rem;
  width: auto;
  overflow: visible;
  fill: currentColor;
}

.kv-logo-arm.is-top { --dx: 18px; --dy: -18px; }
.kv-logo-arm.is-bottom { --dx: -18px; --dy: 18px; }

.kv-logo-arm,
.kv-logo-bond {
  transition: fill .8s ease .15s;
}

.kv-logo-mark.is-out .kv-logo-arm.is-top,
.kv-logo-mark.is-in .kv-logo-arm.is-top { fill: var(--kv-orange); }

.kv-logo-mark.is-out .kv-logo-arm.is-bottom,
.kv-logo-mark.is-in .kv-logo-arm.is-bottom { fill: var(--kv-cyan); }

.kv-logo-mark.is-out .kv-logo-bond,
.kv-logo-mark.is-in .kv-logo-bond { fill: var(--kv-amber); }

.kv-logo-mark.is-out .kv-logo-arm {
  transition: fill .3s ease;
  animation: kvOut 0.6s cubic-bezier(0.8, 0, 0.8, 0.3) 0.15s both;
}

.kv-logo-mark.is-out .kv-logo-bond {
  transition: fill .3s ease;
  animation: kvFadeOut 0.3s cubic-bezier(0.75, 0, 0.75, 0.9) both;
}

.kv-logo-mark.is-in .kv-logo-arm {
  animation: kvIn 1.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.kv-logo-mark.is-in .kv-logo-bond {
  animation: kvFade 1s ease 1.5s both;
}

@keyframes kvFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes kvFadeOut { from { opacity: 1; } to { opacity: 0; } }

@keyframes kvIn {
  from { transform: translate(var(--dx), var(--dy)); opacity: 0; }
  to { transform: translate(0, 0); opacity: 1; }
}

@keyframes kvOut {
  from { transform: translate(0, 0); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .kv-logo-mark * { animation: none !important; }
}
