/* ==========================================================================
   K&J Holdings — home page
   Implemented from the design source "KJ Holdings.dc.html".
   Values (colours, type, spacing, timings) are taken from that file verbatim.
   ========================================================================== */

:root {
  --bg: #000;
  --ink: #fff;
  --muted: #9a9a9a;
  --line: #2a2a2a;
  --line-hover: #4a4a4a;
  --panel: #1a1a1a;
  --well: #050505;

  --sans: Inter, system-ui, sans-serif;
  --display: Outfit, sans-serif;

  --section-y: clamp(96px, 12vw, 176px);
  --stack: clamp(56px, 7vw, 96px);
  --ease-reveal: cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* ---------- base ---------- */

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--sans);
  min-height: 100vh;
}

* {
  box-sizing: border-box;
}

a,
button,
input,
textarea,
select,
label {
  touch-action: manipulation;
}

a {
  color: var(--ink);
  text-decoration: none;
}

@media (hover: hover) {
  a:hover {
    color: var(--muted);
  }
}

::selection {
  background: var(--ink);
  color: var(--bg);
}

input:-webkit-autofill,
textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  transition: background-color 99999s;
}

input::placeholder,
textarea::placeholder {
  color: #5a5a5a;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- shared pieces ---------- */

.section {
  padding: var(--section-y) 24px;
}

.section__inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--stack);
}

.section__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  letter-spacing: -0.03em;
  font-size: clamp(34px, 3.6vw, 56px);
  line-height: 1.05;
  text-wrap: balance;
}

.lede {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.6;
  text-wrap: pretty;
}

.pill {
  display: inline-block;
  max-width: 100%;
  padding: 7px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

/* Underlined inline link with a 44px-tall hit area that doesn't disturb flow. */
.ulink {
  display: inline-block;
  padding: 11px 0;
  margin: -11px 0;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line);
}

@media (hover: hover) {
  .ulink:hover {
    text-decoration-color: var(--ink);
  }
}

.ulink--muted {
  color: var(--muted);
}

@media (hover: hover) {
  .ulink--muted:hover {
    color: var(--ink);
  }
}

/* ---------- wordmark ---------- */

.mark {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.mark__k {
  font-family: var(--display);
  font-weight: 300;
  font-size: 28px;
  letter-spacing: -0.03em;
  line-height: 1;
  white-space: nowrap;
}

.mark__rule {
  width: 1px;
  height: 19px;
  background: currentColor;
  opacity: 0.6;
  flex: none;
}

.mark__word {
  font-family: var(--display);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

/* ---------- navigation ---------- */

.nav {
  position: fixed;
  z-index: 50;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
}

/* Desktop bar */
.nav--desktop {
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1040px, calc(100% - 48px));
  height: 64px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  column-gap: 32px;
  align-items: center;
  padding: 0 24px;
}

.nav--desktop .nav__brand {
  display: flex;
  align-items: center;
  justify-self: start;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  line-height: 1;
  color: var(--ink);
  transition: color 0.3s ease;
}

@media (hover: hover) {
  .nav__link:hover {
    color: var(--muted);
  }
}

.nav__dot {
  width: 7px;
  height: 7px;
  background: var(--ink);
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.4s ease;
  display: block;
}

/* Scoped to the attribute, not the class, so the mobile menu lights up too. */
[aria-current='true'] .nav__dot {
  opacity: 1;
}

/* Mobile bar */
.nav--mobile {
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 18px;
}

.nav--mobile .nav__brand {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 0 1 auto;
}

.nav--mobile .mark {
  flex-wrap: wrap;
  column-gap: 7px;
  height: 24px;
  overflow: hidden;
}

.nav--mobile .mark__k {
  font-size: 24px;
}

.nav--mobile .mark__tail {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 24px;
}

.nav--mobile .mark__rule {
  height: 16px;
}

.nav__toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.3s ease;
}

@media (hover: hover) {
  .nav__toggle:hover {
    border-color: var(--line-hover);
  }
}

/* Three lines that fold into a cross when the menu is open. */
.nav__burger {
  position: relative;
  display: block;
  width: 16px;
  height: 10px;
}

.nav__burger span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.3s var(--ease-reveal), opacity 0.2s ease;
}

.nav__burger span:nth-child(1) {
  top: 0;
}

.nav__burger span:nth-child(2) {
  top: 50%;
  transform: translateY(-50%);
}

.nav__burger span:nth-child(3) {
  bottom: 0;
}

.nav__toggle[aria-expanded='true'] .nav__burger span:nth-child(1) {
  transform: translateY(4.25px) rotate(45deg);
}

.nav__toggle[aria-expanded='true'] .nav__burger span:nth-child(2) {
  opacity: 0;
}

.nav__toggle[aria-expanded='true'] .nav__burger span:nth-child(3) {
  transform: translateY(-4.25px) rotate(-45deg);
}

/* Open: the bar becomes the head of the panel below it. */
.nav--mobile[data-open='true'] {
  border-bottom-color: transparent;
  border-radius: 4px 4px 0 0;
}

/* One bar at a time, switched by viewport rather than by script. */
.nav--mobile,
#mobile-menu {
  display: none;
}

@media (max-width: 959px) {
  .nav--desktop {
    display: none;
  }

  .nav--mobile {
    display: flex;
  }
}

/* Mobile menu: a panel that drops out of the bar, which sits over its head. */
#mobile-menu {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  max-height: calc(100dvh - max(16px, env(safe-area-inset-top)) - 24px);
  z-index: 40;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 56px 0 10px;
}

@media (max-width: 959px) {
  #mobile-menu[data-open='true'] {
    display: flex;
    animation: menu-drop 0.32s var(--ease-reveal);
  }
}

@keyframes menu-drop {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.menu__links {
  display: flex;
  flex-direction: column;
}

.menu__link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 18px;
  font-size: 17px;
  line-height: 1.2;
  color: var(--ink);
}

.menu__link .nav__dot {
  width: 8px;
  height: 8px;
  transition: none;
}

/* ---------- 01 hero ---------- */

.hero {
  position: relative;
  height: 100svh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse 80% 60% at 50% 45%, #171717 0%, #050505 70%, #000 100%);
}

.hero__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__video {
  opacity: 0;
  transition: opacity 2.4s ease;
}

.hero__video[data-ready='true'] {
  opacity: 1;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.hero__fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 45%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, #000 100%);
}

.hero__inner {
  position: relative;
  z-index: 1;
  padding: 0 24px;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}

.hero__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  letter-spacing: -0.03em;
  font-size: clamp(40px, 5.2vw, 80px);
  line-height: 1;
  text-wrap: balance;
}

.hero__sub {
  margin: 0;
  max-width: 820px;
  color: var(--muted);
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.6;
  text-wrap: pretty;
}

/* Break the sentence onto two lines while there is room for it. */
.hero__sub > span {
  display: block;
}

@media (max-width: 899px) {
  .hero__sub > span {
    display: inline;
  }
}

/* ---------- 02 what we've built ---------- */

.stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 56px 24px;
}

@media (max-width: 767px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Phones only: the shorter label, on a single line. */
.pill--swap .pill__narrow {
  display: none;
}

@media (max-width: 599px) {
  .pill--swap {
    white-space: nowrap;
  }

  .pill--swap .pill__wide {
    display: none;
  }

  .pill--swap .pill__narrow {
    display: inline;
  }
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  text-align: center;
  min-width: 0;
  height: 100%;
}

/* Deliberately unreadable: the figures are private. */
.stat__well {
  position: relative;
  width: min(100%, 240px);
  height: clamp(64px, 6vw, 88px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: var(--well);
  background-image: radial-gradient(120% 140% at 50% 0%, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 60%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat__cipher {
  font-family: var(--display);
  font-weight: 300;
  letter-spacing: -0.02em;
  font-size: clamp(34px, 3.6vw, 56px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink);
  opacity: 0.6;
  filter: blur(9px);
  user-select: none;
}

.stat__scan {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.35) 0px,
    rgba(0, 0, 0, 0.35) 1px,
    rgba(0, 0, 0, 0) 1px,
    rgba(0, 0, 0, 0) 4px
  );
  pointer-events: none;
}

.stat__sheen {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 45%;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.07) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: kjSheen 6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  animation-delay: var(--sheen, 0s);
  transform: translateX(-120%);
  pointer-events: none;
}

@keyframes kjSheen {
  0% {
    transform: translateX(-120%);
  }
  55%,
  100% {
    transform: translateX(260%);
  }
}

.stat__tag {
  position: absolute;
  left: 10px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stat__tag span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  display: block;
}

.stats__note {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

/* ---------- 03 what we do ---------- */

.cards {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 767px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

.card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: clamp(440px, 42vw, 540px);
  padding: 28px;
  background-color: var(--well);
  /* Follows the pointer; --mx/--my are set in app.js. */
  background-image: radial-gradient(
    560px circle at var(--mx, 50%) var(--my, -30%),
    rgba(255, 255, 255, 0.075),
    rgba(255, 255, 255, 0) 60%
  );
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 64px;
  transition: border-color 0.6s ease;
}

@media (hover: hover) {
  .card:hover {
    border-color: var(--line-hover);
  }
}

@media (max-width: 767px) {
  .card {
    min-height: 360px;
  }
}

.card__ghost {
  position: absolute;
  right: -0.04em;
  top: 50%;
  transform: translateY(-62%);
  font-family: var(--display);
  font-weight: 200;
  font-size: clamp(170px, 18vw, 260px);
  line-height: 1;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1px var(--line);
  pointer-events: none;
  user-select: none;
}

.card__top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card__num {
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.card__body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  letter-spacing: -0.03em;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.05;
  text-wrap: balance;
}

.card__line {
  margin: 0;
  max-width: 300px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
  text-wrap: pretty;
}

/* ---------- 04 our approach ---------- */

.principles {
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--line);
}

.principle {
  display: grid;
  grid-template-columns: 64px minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  padding: 56px 0;
  border-top: 1px solid var(--line);
}

@media (max-width: 767px) {
  .principle {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 36px 0;
  }
}

/* Rows dim until scrolled past, then stay lit. */
.principle__num,
.principle__lead,
.principle__rest {
  opacity: 0.18;
  transition: opacity 1.2s ease;
}

.principle__rest {
  transition-delay: 0.15s;
}

.principle[data-lit='true'] .principle__num,
.principle[data-lit='true'] .principle__lead,
.principle[data-lit='true'] .principle__rest {
  opacity: 1;
}

.principle__num {
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.principle__lead {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  letter-spacing: -0.03em;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.05;
  color: var(--ink);
  text-wrap: balance;
}

.principle__rest {
  margin: 0;
  max-width: 380px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
  text-wrap: pretty;
}

/* ---------- 05 get in touch ---------- */

.contact .section__inner {
  max-width: 640px;
  gap: clamp(48px, 6vw, 72px);
}

.form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
}

.field__label {
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.field__label--split {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.field__input {
  width: 100%;
  height: 56px;
  padding: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  font: 400 17px var(--sans);
  outline: none;
  transition: border-color 0.3s ease;
}

.field__input:focus {
  border-bottom-color: var(--ink);
}

textarea.field__input {
  min-height: 120px;
  height: auto;
  padding: 16px 0;
  line-height: 1.6;
  resize: vertical;
}

/* Reserved so validation messages never shift the layout. */
.field__error {
  min-height: 22px;
  padding-top: 6px;
  font-size: 13px;
  line-height: 1.3;
  color: var(--ink);
}

.field__spacer {
  min-height: 22px;
}

.form__foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding-top: 16px;
}

.btn {
  height: 56px;
  min-width: 180px;
  padding: 0 40px;
  background: var(--ink);
  color: var(--bg);
  border: 0;
  border-radius: 4px;
  font: 500 16px var(--sans);
  cursor: pointer;
  transition: opacity 0.3s ease;
}

@media (hover: hover) {
  .btn:hover {
    opacity: 0.8;
  }
}

.btn[disabled] {
  cursor: default;
  opacity: 0.6;
}

.form__alert {
  margin: 0;
  max-width: 420px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  text-align: center;
  text-wrap: pretty;
}

.form__fine {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
  text-wrap: pretty;
}

.form__sent {
  margin: 0;
  padding: 48px 0;
  max-width: 520px;
  text-align: center;
  font-family: var(--display);
  font-weight: 300;
  letter-spacing: -0.02em;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.35;
  text-wrap: balance;
}

[hidden] {
  display: none !important;
}

/* ---------- 06 footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 48px max(24px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom))
    max(24px, env(safe-area-inset-left));
}

.footer__inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer__brand {
  display: flex;
}

.footer__brand .mark {
  gap: 12px;
}

.footer__brand .mark__k {
  font-size: 40px;
}

.footer__brand .mark__rule {
  height: 27px;
}

.footer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  font-size: 15px;
}

.footer__meta > span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer__meta a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.footer__sep {
  color: var(--line);
}

.tbc {
  padding: 2px 6px;
  border: 1px dashed var(--muted);
  border-radius: 4px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.footer__legal {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  text-wrap: pretty;
}

/* ---------- scroll reveal ---------- */

/* Only armed once app.js confirms scripting and full motion, so the content
   is visible by default for crawlers, no-JS and reduced-motion visitors. */
html.has-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 1.3s var(--ease-reveal) var(--reveal-delay, 0ms),
    transform 1.3s var(--ease-reveal) var(--reveal-delay, 0ms);
}

html.has-reveal [data-reveal][data-shown='true'] {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
    animation: none !important;
  }
}
