/*
 * ETLytics (datalyticaai.com) — site styles.
 *
 * Every section of the page is a full-width "card" (.g-card) on top of a fixed
 * background picture. Colours, fonts and sizes are set once in :root below —
 * change them there and the whole page follows.
 *
 * Contents:
 *   1. Settings (colours, fonts, spacing)
 *   2. Base
 *   3. Buttons
 *   4. Sections (cards) and the hero picture
 *   5. Text
 *   6. Team columns (icon on top)
 *   7. Extract / Transform / Load arrows
 *   8. Bar chart
 *   9. Footer
 *  10. Reveal-on-scroll animation
 */

/* ---------- 1. Settings ---------- */
:root {
  /* Fonts (loaded from Google Fonts in the <head> of each page) */
  --g-font-heading: "Petrona", ui-sans-serif, system-ui, sans-serif;
  --g-font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --g-heading-weight: 700;
  --g-heading-scale: 1.05; /* 1 = normal, 1.1 = headings 10% larger */
  --g-ls: -0.02em; /* letter spacing */

  /* Colours */
  --g-text: #e0d6de;
  --g-heading: #a680ff; /* used if the gradient below is switched off */
  --g-heading-gradient: linear-gradient(135deg, #a680ff 5%, #ff85b8 45%, #ffb070 85%);
  --g-accent: #9a81df; /* buttons and icons */
  --g-accent-gradient: linear-gradient(6deg, #9a81df 10%, #7456c8 90%);
  --g-button-text: #ffffff;
  --g-shape: #2f1d63; /* arrow shapes */
  --g-shape-border: #48367c;

  /* Page background and sections */
  --g-bg: #13131a;
  --g-bg-image: url("/assets/images/background.jpg");
  --g-card: rgba(12, 5, 36, 0.75); /* section colour, 75% opaque so the background shows through */
  --g-card-solid: #0c0524;
  --g-blur: 20px; /* frosted-glass blur of the background behind the sections */
  --g-radius: 7px; /* corner rounding of buttons and pictures */

  /* Layout */
  --g-fs: 18px; /* body text size */
  --g-pad-y: 85.5px; /* space above and below the content of each section */
  --g-pad-x: 63px; /* space left and right of the content */
  --g-max: 1161px; /* maximum width of the sections' content area */
}

@media (max-width: 767px) {
  :root {
    --g-fs: 16px;
    --g-pad-y: 44px;
    --g-pad-x: 20px;
  }
}

/* ---------- 2. Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

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

body.g-page {
  margin: 0;
  min-height: 100vh;
  background-color: var(--g-bg);
  color: var(--g-text);
  font-family: var(--g-font-body);
  font-size: var(--g-fs);
  line-height: 1.6;
  letter-spacing: var(--g-ls);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

/* Fixed page background (works on iOS, unlike background-attachment: fixed). */
body.g-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    var(--g-bg-image) center / cover no-repeat,
    var(--g-bg);
  pointer-events: none;
}

/* Short pages (404): the last section grows so the footer sits at the bottom. */
body.g-page {
  display: flex;
  flex-direction: column;
}
body.g-page > main {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
}
body.g-page > main > :last-child {
  flex-grow: 1;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

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

/* "Skip to content" link, visible only when reached with the keyboard */
.g-skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--g-card-solid);
  color: var(--g-text);
  border-radius: var(--g-radius);
}

.g-skip:focus {
  top: 12px;
}

/* Hidden on screen, read by screen readers (the chart's data table) */
.g-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 3. Buttons ---------- */
.g-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.g-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  max-width: 100%;
  padding: 9px 18px;
  border: 0;
  border-radius: var(--g-radius);
  background-color: var(--g-accent);
  background-image: var(--g-accent-gradient);
  color: var(--g-button-text);
  font-family: var(--g-font-body);
  font-size: 1em;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: var(--g-ls);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    filter 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
}

.g-btn:hover {
  filter: brightness(1.08) saturate(1.05);
  transform: translateY(-1px);
}
.g-btn:active {
  transform: none;
}

/* ---------- 4. Sections (cards) ---------- */
.g-card {
  position: relative;
  background: var(--g-card);
  -webkit-backdrop-filter: blur(var(--g-blur)) saturate(1.7);
  backdrop-filter: blur(var(--g-blur)) saturate(1.7);
}

/* Remove the class "is-glass" from <body> to switch the blur off. */
body:not(.is-glass) .g-card {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.g-card__layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: var(--g-max);
  margin: 0 auto;
}

.g-card__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: var(--g-pad-y) var(--g-pad-x);
}

.g-card__content {
  min-width: 0;
}

.g-card__content > * {
  margin-top: 0;
  margin-bottom: 0;
}
.g-card__content > * + * {
  margin-top: 1.1em;
}
.g-card__content > .g-chart + .g-items {
  margin-top: 1.6em;
}

/* Picture on the right (class g-card--right) or on the left (g-card--left) */
.g-card--left .g-card__layout {
  grid-template-columns: minmax(0, 37.5fr) minmax(0, 62.5fr);
}
.g-card--right .g-card__layout {
  grid-template-columns: minmax(0, 62.5fr) minmax(0, 37.5fr);
}
.g-card--right .g-card__accent {
  order: 2;
}

.g-card--left .g-card__content,
.g-card--right .g-card__content {
  max-width: 600px;
}

.g-card__accent {
  position: relative;
  min-height: 300px;
  margin: 18px 0;
  overflow: hidden;
  border-radius: var(--g-radius);
}

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

/* Phones: the picture goes above the text */
@media (max-width: 767px) {
  .g-card--left .g-card__layout,
  .g-card--right .g-card__layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .g-card--left .g-card__accent,
  .g-card--right .g-card__accent {
    order: 0;
    min-height: 0;
    aspect-ratio: 4 / 3;
    max-height: 70vh;
    margin: 24px var(--g-pad-x) 0;
  }

  .g-card--left .g-card__body,
  .g-card--right .g-card__body {
    padding-top: 32px;
  }

  .g-card--left .g-card__content,
  .g-card--right .g-card__content {
    max-width: none;
  }
}

/* ---------- 5. Text ---------- */
/* Section headings (gradient text) */
.g-h {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: -0.25em 0 0;
  padding-block: 0.25em;
  font-family: var(--g-font-heading);
  font-weight: var(--g-heading-weight);
  font-size: calc(var(--g-heading-scale) * clamp(1.875rem, 0.6rem + 4.6vw, 2.8125rem));
  line-height: 1.25;
  letter-spacing: var(--g-ls);
  color: var(--g-heading);
  overflow-wrap: break-word;
}

/* Remove the class "has-heading-gradient" from <body> for plain-coloured headings. */
.has-heading-gradient .g-h {
  background-image: var(--g-heading-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.g-card__content > .g-h + * {
  margin-top: 0.9em;
}
.g-card__content > .g-h + .g-items {
  margin-top: 1.33em;
}
.g-card__content > .g-h + .g-chart {
  margin-top: 2.1em;
}

/* Paragraph blocks */
.g-prose {
  overflow-wrap: break-word;
}
.g-prose > * {
  margin: 0;
}
.g-prose > * + * {
  margin-top: 1.1em;
}
.g-prose p:empty {
  display: none;
}
.g-prose a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--g-accent);
  text-underline-offset: 3px;
}
.g-prose a:hover {
  color: var(--g-accent);
}
.g-prose ul,
.g-prose ol {
  padding-left: 1.3em;
}
.g-prose li + li {
  margin-top: 0.35em;
}
.g-prose strong,
.g-prose b {
  font-weight: 700;
}

/* Small headings and text of the team members and the arrows */
.g-item__title {
  margin: 0;
  font-family: var(--g-font-heading);
  font-weight: var(--g-heading-weight);
  font-size: calc(1.25em * var(--g-heading-scale));
  line-height: 1.25;
  letter-spacing: var(--g-ls);
  color: var(--g-text);
  overflow-wrap: break-word;
}

.g-item__title + .g-item__text {
  margin-top: 0.6em;
}

.g-item__text {
  margin: 0;
  overflow-wrap: break-word;
}

@media (max-width: 767px) {
  .g-item__title {
    font-size: calc(1.15em * var(--g-heading-scale));
  }
}

/* ---------- 6. Team columns (icon on top) ---------- */
.g-items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.g-items > li {
  min-width: 0;
}

.g-item__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 45px;
  height: 45px;
  font-size: 36px;
  line-height: 1;
}

.g-items--icons_top .g-item__icon i {
  background-image: var(--g-accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--g-accent);
}

.g-items--icons_top {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  gap: 32px 22px;
}

.g-items--icons_top .g-item__icon {
  justify-content: flex-start;
  margin-bottom: 22px;
}

@media (max-width: 639px) {
  .g-items--icons_top {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .g-items--icons_top .g-item__icon {
    width: 40px;
    height: 40px;
    font-size: 32px;
    margin-bottom: 12px;
  }
}

/* ---------- 7. Extract / Transform / Load arrows ---------- */
.g-step {
  position: relative;
}

.g-step__shape {
  position: relative;
  color: var(--g-text);
}

/* The arrow is drawn twice: outline colour, then the fill 1px smaller. */
.g-step__shape::before,
.g-step__shape::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--g-shape-border);
  -webkit-clip-path: var(--clip);
  clip-path: var(--clip);
}

.g-step__shape::after {
  inset: 1px;
  background: var(--g-shape);
}

.g-step__icon {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px;
  line-height: 1;
}

/* Arrows in a row */
.g-items--steps_horizontal {
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
}

.g-items--steps_horizontal .g-step__shape {
  height: 72px;
  --clip: polygon(0 0, calc(100% - 20px) 0, 100% 50%, calc(100% - 20px) 100%, 0 100%, 20px 50%);
}

.g-items--steps_horizontal .g-step:not(:last-child) .g-step__shape {
  margin-right: -16px;
}
.g-items--steps_horizontal .g-step:not(:last-child) .g-step__icon {
  margin-left: -8px;
}

.g-items--steps_horizontal .g-item__body {
  padding: 18px 18px 0;
}

/* Phones: arrows pointing down, text beside them */
@media (max-width: 767px) {
  .g-items--steps_horizontal {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    padding-bottom: 16px;
  }

  .g-items--steps_horizontal .g-step {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    column-gap: 18px;
    min-height: 96px;
  }

  .g-items--steps_horizontal .g-step__shape,
  .g-items--steps_horizontal .g-step:not(:last-child) .g-step__shape {
    height: auto;
    margin: 0 0 -16px;
    --clip: polygon(0 0, 50% 16px, 100% 0, 100% calc(100% - 16px), 50% 100%, 0 calc(100% - 16px));
  }

  .g-items--steps_horizontal .g-step:not(:last-child) .g-step__icon {
    margin-left: 0;
  }
  .g-items--steps_horizontal .g-item__body {
    align-self: center;
    padding: 10px 0;
  }

  .g-step__icon {
    font-size: 19px;
  }
}

/* ---------- 8. Bar chart ---------- */
/* Values are set in the HTML: --max on the <figure> (top of the scale), --v on each bar. */
.g-chart {
  margin: 0;
}

.g-chart__plot {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: clamp(220px, 32vw, 460px) auto;
  column-gap: 10px;
}

/* Numbers on the left (0, 40, 80, 120) */
.g-chart__axis {
  position: relative;
  min-width: 2ch;
  font-size: 0.9em;
  line-height: 1;
}

.g-chart__axis span {
  position: absolute;
  right: 0;
  transform: translateY(50%);
  white-space: nowrap;
}

.g-chart__area {
  position: relative;
  display: flex;
  align-items: stretch;
  padding-inline: 3.5%;
  border-left: 2px solid color-mix(in srgb, var(--g-text) 85%, transparent);
  border-bottom: 2px solid color-mix(in srgb, var(--g-text) 85%, transparent);
}

.g-chart__grid {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: color-mix(in srgb, var(--g-text) 22%, transparent);
  pointer-events: none;
}

/* One group of bars per category */
.g-chart__group {
  position: relative;
  display: flex;
  flex: 1 1 0;
  align-items: flex-end;
  justify-content: center;
  gap: 5%;
}

.g-chart__bar {
  position: relative;
  height: calc(var(--v) / var(--max) * 100%);
  flex: 0 1 20%;
  min-width: 6px;
  border-radius: 4px 4px 0 0;
  background: var(--bar);
  transition: filter 0.2s;
}

.g-chart__bar:hover {
  filter: brightness(1.15);
}

/* Category names under the bars */
.g-chart__labels {
  grid-column: 2;
  display: flex;
  padding: 6px 3.5% 0;
}

.g-chart__labels span {
  flex: 1 1 0;
  min-width: 0;
  padding-inline: 2px;
  text-align: center;
  font-size: 0.9em;
  line-height: 1.25;
  overflow-wrap: break-word;
}

/* Colour legend */
.g-chart__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 28px;
  margin-top: 10px;
  font-size: 0.9em;
  line-height: 1.3;
}

.g-chart__legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.g-chart__legend i {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  flex: 0 0 auto;
}

@media (min-width: 768px) {
  /* Plot height grows with the chart width like the original (479px at full width). */
  .g-chart {
    container-type: inline-size;
  }
  .g-chart__plot {
    grid-template-rows: calc(50.95cqw - 48.5px) auto;
    column-gap: 13px;
  }

  /* Axis text scales with the chart like the original (19px at full width), never below 13px. */
  .g-chart__axis,
  .g-chart__labels span {
    font-size: max(13px, 1.84cqw);
  }
  .g-chart__axis {
    min-width: 1.85em;
  }
  .g-chart__labels {
    padding-top: 8px;
  }
  .g-chart__labels span {
    position: relative;
    line-height: 1.2;
  }

  /* Small tick marks on both axes */
  .g-chart__axis span::after,
  .g-chart__labels span::before {
    content: "";
    position: absolute;
    background: color-mix(in srgb, var(--g-text) 85%, transparent);
  }

  .g-chart__axis span::after {
    top: 50%;
    right: -13px;
    width: 8px;
    height: 2px;
    margin-top: -1px;
  }
  .g-chart__labels span::before {
    top: -8px;
    left: 50%;
    width: 2px;
    height: 8px;
    margin-left: -1px;
  }

  .g-chart__legend {
    margin-top: 0;
    padding-left: 66px;
    font-size: 1em;
    column-gap: max(28px, calc(16.8cqw - 63px));
  }

  .g-card__content > .g-chart + .g-items {
    margin-top: 3em;
  }
  .g-card__content > .g-items--steps_horizontal + .g-prose {
    margin-top: 2.25em;
  }
}

@media (max-width: 767px) {
  .g-chart__plot {
    grid-template-rows: 240px auto;
    column-gap: 6px;
  }
  .g-chart__axis,
  .g-chart__labels span {
    font-size: 12px;
  }
  .g-chart__legend {
    gap: 6px 18px;
    font-size: 14px;
  }

  /* Narrow screens: no outer padding, so the category names get the full width. */
  .g-chart__area,
  .g-chart__labels {
    padding-inline: 0;
  }
}

@media (max-width: 359px) {
  .g-chart__labels span {
    padding-inline: 0;
    font-size: 11px;
  }
}

/* ---------- 9. Footer ---------- */
.g-footer {
  background: var(--g-card);
  border-top: 1px solid color-mix(in srgb, var(--g-text) 10%, transparent);
  font-size: 15px;
}

body.is-glass .g-footer {
  -webkit-backdrop-filter: blur(var(--g-blur)) saturate(1.7);
  backdrop-filter: blur(var(--g-blur)) saturate(1.7);
}

.g-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  max-width: var(--g-max);
  margin: 0 auto;
  padding: 28px var(--g-pad-x);
}

.g-footer__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.g-footer__name {
  margin: 0;
  font-family: var(--g-font-heading);
  font-weight: 600;
}
.g-footer__name a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: inherit;
  text-decoration: none;
}
.g-footer__name a:hover {
  color: var(--g-accent);
}
.g-footer__text {
  margin: -6px 0 0;
  opacity: 0.8;
}
.g-footer__copy {
  flex-basis: 100%;
  margin: 0;
  opacity: 0.65;
  font-size: 14px;
}

/* ---------- 10. Reveal on scroll ---------- */
/* Elements with class g-reveal fade in when they scroll into view (assets/js/main.js). */
@media (prefers-reduced-motion: no-preference) {
  .js .g-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition:
      opacity 0.6s ease,
      transform 0.6s ease;
  }

  .js .g-reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}
