html {
  scroll-behavior: smooth;
}

/* ==========================================
   1. GLOBAL STYLES - Variables
   ========================================== */
:root {
  --color-primary-dark: #1f2937;
  --color-primary-med: #aeb2bd;
  --color-primary-light: #cacdd5;
  --color-primary-lighter: #f9faf8;
  --color-secondary: #3882f6;
  --color-secondary-dark: #2874ef;

  --bg-header-hero-footer: var(--color-primary-dark);
  --bg-button-cta: var(--color-secondary);
  --bg-quote: var(--color-primary-light);

  --text-logo: var(--color-primary-lighter);
  --text-hero-main: var(--color-primary-lighter);
  --text-hero-sec: var(--color-primary-med);
  --text-info-heading: var(--color-primary-dark);
  --text-quote: var(--color-primary-dark);
}

/* ==========================================
   2. GLOBAL STYLES - Resets
   ========================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}
blockquote {
  margin: 0;
  padding: 0;
  border: 0;
}
h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
  padding: 0;
}
a {
  text-decoration: none;
  color: inherit;
}
body {
  margin: 0;
  padding: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 1rem;
}
button {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* ==========================================
   3. Layout Constraints
   ========================================== */
.container {
  max-width: 64rem;
  /* Centers content horizontally */
  /* margin-inline = margin-left: auto; margin-right: auto; */
  margin-inline: auto;
  /* keeps content off the edge on small screens */
  padding-inline: 1rem;
}
.container-narrow {
  max-width: 51rem;
  margin-inline: auto;
  padding-inline: 1rem;
}
.container.bubble {
  background-color: var(--color-secondary);
  border-radius: 0.5rem;
  margin-block: 5rem;
  padding-block: 3rem;
}

/* ==========================================
   4. Background Colors
   ========================================== */

.dark-bg {
  background-color: var(--bg-header-hero-footer);
}
.light-bg {
  background-color: var(--color-primary-lighter);
}
.grey-bg {
  background-color: var(--color-primary-light);
}
.bubble-bg {
  color: var(--color-primary-lighter);
}

/* ==========================================
   5. Header
   ========================================== */
.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-logo);
}
.links {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
}
.link {
  font-size: 1.125rem;
  color: var(--text-hero-sec);
}
.header {
  display: flex;
  padding-block: 1rem;
}
header {
  position: sticky;
  top: 0;
  z-index: 10;
}

/* ==========================================
   6. Button
   ========================================== */

.btn {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 0.5em;
  padding: 0.8em 3em;
  background-color: var(--bg-button-cta);
  transition: background-color 0.2s ease-in-out 0.1s;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}

.btn:hover,
.btn:focus-visible {
  background-color: var(--color-secondary-dark);
}

.fill {
  color: var(--color-primary-lighter);
}

.border {
  border: 2px solid var(--color-primary-lighter);
  color: var(--color-primary-lighter);
}

/* ==========================================
   7. Hero
   ========================================== */
.hero {
  color: var(--text-hero-main);
  display: flex;
  padding-block: 7rem;
  gap: 2.5rem;
  /* Add flex-wrap so children wrap on mobile */
  flex-wrap: wrap;
}
.hero p {
  color: var(--text-hero-sec);
}
.hero .details {
  /* Changed from flex: 1 1 0
  so that flex-wrap can happen on mobile */
  flex: 1 0 18.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
}
.hero figure {
  /* Changed from flex: 1 1 0
  so that flex-wrap can happen on mobile */
  flex: 1 0 18.75rem;
  min-width: 0; /* lets the column shrink below the image's natural width */
  margin: 0; /* removes the browser's default figure margins*/
}
/* Make the image behave like a flexible layer instead of a fixed-size picture */
.hero img {
  /* without this, the image doesn't shrink when parent shrinks */
  /* max-width: 100% stops the image from overflowing, so it shrinks to fit */
  max-width: 100%;
  /* without this, the width shrinks but the height doesn't */
  /* height: auto; scales the height in proportion */
  height: auto;
  /* without this there may be a tiny stray gap at the bottom of image */
  display: block;
}
figure img {
  border-radius: 0.5rem;
}

figcaption {
  color: var(--color-primary-med);
  font-size: 0.875rem;
  font-weight: 300;
  font-style: italic;
}

/* ==========================================
   8. Features
   ========================================== */
.features {
  padding-block: 5rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  text-align: center;
}
.features h2 {
  font-size: 2rem;
  font-weight: 800;
}
.cards {
  display: flex;
  gap: 1rem;
}
.card {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--color-primary-dark);
  margin-inline: 0.5rem;
}
/* .card a {
  overflow: hidden;
  border-radius: 0.5rem;
} */

.card img {
  /* Tell img to fill container */
  max-width: 100%;
  /* Tell img to scale height proportionately with width */
  height: auto;
  transition: transform 0.2s ease-in-out;
  border-radius: 0.5rem;
}
.card img:hover,
.card img:focus-visible {
  transform: scale(1.07);
}
.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-secondary);
}

/* ==========================================
   9. Quote
   ========================================== */
blockquote {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: var(--color-primary-light);
  font-size: 2.25rem;
  color: var(--text-quote);
  font-weight: 300;
  font-style: italic;
  padding-block: 8rem;
}
blockquote footer {
  font-size: 1.125rem;
  font-style: normal;
  font-weight: 600;
  align-self: flex-end;
  color: var(--color-primary-dark);
}

/* ==========================================
   10. Bubble - CTA
   ========================================== */
/* CTA contents has an inner constraint of max 51rem as well */
.cta-contents {
  /* Set this layout constraint container to be the same as .container-narrow */
  max-width: 51rem;
  /* Center horizontally */
  margin-inline: auto;
  /* Arrange children in a flex row */
  display: flex;
  /* Position children to both left and right edges */
  justify-content: space-between;
  /* Set space between cta-text and button */
  gap: 1rem;
  /* Add flex-wrap */
  flex-wrap: wrap;
  /* Ensure button does not increase in height when text increases in height */
  align-items: flex-end;
}

a.btn.border {
  flex: 1 0 3rem;
}
.cta-text {
  flex: 8 0 18.75rem;
}

/* ==========================================
   11. Footer
   ========================================== */
footer {
  color: var(--text-hero-sec);
  padding: 2.5rem;
  /*Centralise content on both axis*/
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}
