/* ==========================================================================
   GCKK — global.css
   Reset · design tokens · typography · shared utilities & components
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Colors */
  --color-primary: #d90b27;
  --color-primary-hover: #b80920;
  --color-dark: #08131e;
  --color-darkest: #04080c;
  --color-text: #686e74;
  --color-text-light: #dadcdb;
  --color-border: #dadcdb;
  --color-input-border: #dcdcde;
  --color-surface: #f7f7f5;
  --color-surface-border: #f0ede8;
  --color-white: #ffffff;
  --color-placeholder: rgba(104, 110, 116, 0.5);
  --color-line-light: rgba(218, 220, 219, 0.32);
  --color-footer-muted: rgba(255, 255, 255, 0.7);

  /* Overlays */
  --overlay-card: linear-gradient(221deg, #08131e 0%, rgba(8, 19, 30, 0.7) 14%, rgba(8, 19, 30, 0.4) 45%, rgba(8, 19, 30, 0.7) 76%, #08131e 100%);

  /* Typography */
  --font-base: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;

  --fs-h1: 3rem;        /* 48 → 64 */
  --fs-h2: 2rem;        /* 32 → 48 */
  --fs-h3: 1.5rem;      /* 24 → 32 */
  --fs-h4: 1.5rem;      /* 24 */
  --fs-body-l: 1.125rem;/* 18 */
  --fs-body: 1rem;      /* 16 */
  --fs-small: 0.875rem; /* 14 */
  --fs-xs: 0.75rem;     /* 12 */

  --lh-tight: 1.1;
  --lh-heading: 1.2;
  --lh-body: 1.3;

  --ls-caption: 0.1429em;
  --ls-body: 0.0125em;
  --ls-cta: 0.0144em;

  /* Spacing scale (4px base) */
  --space-1: 0.25rem;  /* 4 */
  --space-2: 0.375rem; /* 6 */
  --space-3: 0.5rem;   /* 8 */
  --space-4: 0.75rem;  /* 12 */
  --space-5: 1rem;     /* 16 */
  --space-6: 1.5rem;   /* 24 */
  --space-7: 2rem;     /* 32 */
  --space-8: 3rem;     /* 48 */
  --space-9: 4rem;     /* 64 */
  --space-10: 6rem;    /* 96 */

  /* Layout */
  --container-max: 90rem; /* 1440 */
  --gutter: 1rem;         /* 16 → 32 → 64 */
  --section-y: 3rem;      /* 48 → 96 */
  --grid-gap: 3rem;       /* 48 */

  /* Shape & motion */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --shadow-dropdown: 0 0.75rem 2rem rgba(8, 19, 30, 0.16);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 0.3s;

  --header-z: 50;
}

@media (min-width: 48em) {
  :root {
    --gutter: 2rem;
  }
}

@media (min-width: 75em) {
  :root {
    --fs-h1: 4rem;
    --fs-h2: 3rem;
    --fs-h3: 2rem;
    --gutter: 4rem;
    --section-y: 6rem;
  }
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-base);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  color: var(--color-dark);
  background-color: var(--color-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

img,
picture,
svg,
video,
iframe {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

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

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4 {
  font-weight: var(--fw-medium);
  line-height: var(--lh-heading);
  letter-spacing: 0;
  overflow-wrap: break-word;
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.icon {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.br-lg {
  display: none;
}

@media (min-width: 75em) {
  .br-lg {
    display: inline;
  }
}

/* ---------- Typography ---------- */
.caption {
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-caption);
  text-transform: uppercase;
  color: var(--color-primary);
}

.title-1 {
  font-size: var(--fs-h1);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
}

.title-2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-medium);
  line-height: var(--lh-heading);
}

@media (min-width: 75em) {
  .title-2 {
    font-weight: var(--fw-semibold);
    line-height: var(--lh-tight);
  }
}

.title-3 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-medium);
  line-height: var(--lh-heading);
}

.title-4 {
  font-size: var(--fs-h4);
  font-weight: var(--fw-medium);
  line-height: var(--lh-heading);
}

.text-l {
  font-size: var(--fs-body-l);
  line-height: var(--lh-body);
  letter-spacing: 0.0111em;
  color: var(--color-text);
}

.text {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  line-height: 1;
  letter-spacing: var(--ls-cta);
  text-transform: uppercase;
  white-space: nowrap;
  transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.btn--primary {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.btn--primary:hover {
  background-color: var(--color-primary-hover);
}

.btn--light {
  background-color: var(--color-surface);
  color: var(--color-dark);
}

.btn--light:hover {
  background-color: var(--color-white);
  box-shadow: 0 0 0 1px var(--color-border);
}

.btn--block {
  width: 100%;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--fw-medium);
  line-height: 1;
  letter-spacing: var(--ls-cta);
  text-transform: uppercase;
  color: var(--color-primary);
}

.link-arrow .icon {
  transition: transform var(--duration) var(--ease);
}

.link-arrow:hover .icon {
  transform: translate(2px, -2px);
}

/* ---------- Form fields ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.field__label {
  font-size: var(--fs-body);
  color: var(--color-dark);
}

.field__required {
  color: var(--color-primary);
}

.field__control {
  width: 100%;
  min-height: 2.625rem; /* 42 */
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  background-color: var(--color-white);
  border: 1px solid var(--color-input-border);
  border-radius: var(--radius-sm);
  color: var(--color-dark);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.field__control::placeholder {
  color: var(--color-placeholder);
  opacity: 1;
}

.field__control:hover {
  border-color: #b9bbbd;
}

.field__control:focus {
  outline: none;
  border-color: var(--color-dark);
  box-shadow: 0 0 0 3px rgba(8, 19, 30, 0.08);
}

textarea.field__control {
  min-height: 5.125rem;
  resize: vertical;
}

.field__select {
  position: relative;
}

.field__select .field__control {
  appearance: none;
  padding-right: 2.5rem;
  cursor: pointer;
}

.field__select .field__control:invalid {
  color: var(--color-placeholder);
}

.field__select option {
  color: var(--color-dark);
}

.field__select .icon {
  position: absolute;
  top: 50%;
  right: var(--space-3);
  width: 1.125rem;
  height: 1.125rem;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--color-dark);
}

.form__status {
  font-size: var(--fs-small);
  color: var(--color-dark);
}

.form__status:empty {
  display: none;
}

/* ---------- Decorative vertical grid lines ---------- */
.lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.lines__inner {
  position: relative;
  height: 100%;
}

.lines__inner::before,
.lines__inner::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: var(--line-color, var(--color-line-light));
}

/* mobile: one line at ~85% of content width (x = 320 / 390) */
.lines__inner::before {
  left: calc(var(--gutter) + (100% - 2 * var(--gutter)) * 0.85);
}

.lines__inner::after {
  display: none;
}

/* desktop: lines in the centre of the 1st and 3rd gaps of a 4-col grid (x = 380 / 1060) */
@media (min-width: 75em) {
  .lines__inner::before {
    left: calc(var(--gutter) + (100% - 2 * var(--gutter)) * 0.25 - var(--grid-gap) / 4);
  }

  .lines__inner::after {
    display: block;
    left: calc(var(--gutter) + (100% - 2 * var(--gutter)) * 0.75 + var(--grid-gap) / 4);
  }
}

/* ---------- Scroll reveal (headings) ----------
   Hidden state applies only when the inline <head> script added .js-reveal
   (motion allowed + IntersectionObserver available). */
.js-reveal main :is(.caption, .faq__caption, .title-1, .title-2, .page-hero__lead, .hero__lead, .section-head__text) {
  opacity: 0;
  transform: translate3d(0, 1.25rem, 0);
  filter: blur(4px);
  transition:
    opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1.1s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    letter-spacing 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0s);
}

/* captions also "settle" their tracking */
.js-reveal main :is(.caption, .faq__caption) {
  letter-spacing: 0.32em;
}

.js-reveal main .is-revealed {
  opacity: 1;
  transform: none;
  filter: none;
}

.js-reveal main .caption.is-revealed {
  letter-spacing: var(--ls-caption);
}

.js-reveal main .faq__caption.is-revealed {
  letter-spacing: var(--ls-cta);
}

/* .process__caption / .cta__caption keep their 0.8 opacity */
.js-reveal main :is(.process__caption, .cta__caption).is-revealed {
  opacity: 0.8;
}
