/* ------------------------------------------------- */
/* Custom properties                                 */
/* ------------------------------------------------- */

:root {
  --clr-dark: 230 35% 7%;
  --clr-light: 231 77% 90%;
  --clr-white: 0 0% 100%;

  /* font-sizes */

  /* clamp(min-value, middle-value, max-value) so it depends viewport */
  --fs-900: clamp(5rem, 8vw + 1rem, 9.375rem);
  --fs-800: 6.25rem;
  --fs-700: 3.5rem;
  --fs-600: 2rem;
  --fs-500: 1rem;
  --fs-400: 1.125rem;
  --fs-300: 1rem;
  --fs-200: 0.875rem;

  /* font-families */

  --ff-serif: "Bellefair", serif;
  --ff-sans-cond: "Barlow Condensed", sans-serif;
  --ff-sans-normal: "Barlow", sans-serif;

  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 35em) {
  :root {
      --fs-800: 5rem;
      --fs-700: 2.5rem;
      --fs-600: 1.5rem;
      --fs-500: 1.1rem;
      --fs-400: 1rem;
  }
}

@media (min-width: 45em) {
  :root {
      --fs-800: 6.25rem;
      --fs-700: 3.5rem;
      --fs-600: 2rem;
      --fs-500: 1.25rem;
      --fs-400: 1.125rem;
  }
}


/* ------------------------------------------------- */
/* Reset                                             */
/* Ref: https://piccalil.li/blog/a-modern-css-reset/ */
/* ------------------------------------------------- */

/* box sizing */

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

/* reset margins */

body,
h1,
h2,
h3,
h4,
h5,
p,
figure,
picture {
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    font-weight: 400;
}

/* remove list styles on ul, ol elements with a list role, which suggest */
ul[role="list"],
ol[role="list"] {
  list-style-type: none;
}

/* set up the body */
body {
  font-family: var(--ff-sans-normal);
  font-size: var(--fs-400);
  color: hsl(var(--clr-white));
  background-color: hsl(var(--clr-dark));
  line-height: 1.5;
  min-height: 100vh;
  display: grid;
  grid-template-rows: min-content 1fr;
  overflow-x: hidden;
}

/* make images easier to work with */
img{
  max-width: 100%;
  display: block;
}

/* do not set display property for picture element because used hidden attribute, usage of display overrides hidden */
picture {
  max-width: 100%;
}

/* make forms elements easier to work with */
input,
button,
textarea,
select {
  font: inherit;
}

/* remove animation for people who've turned them off */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------- */
/* Utility classes                                   */
/* ------------------------------------------------- */

/* general */

.flex {
  display: flex;
  gap: var(--gap, 1rem);
}

.grid {
  display: grid;
  gap: var(--gap, 1rem);
}

.d-block {
  display: block;
}

.center {
  text-align: center;
}

/* flow > * + * add margin to any child except has no adjacent sibling before */
/* can be used also .flow > *:not(:first-child) */
/* new css selectors: :is(el, el, ...) > p means each p in any el element */
/* new css selectors: :where() */
.flow>*:where(:not(:first-child)) {
  /* --flow-space is now undefines, so use 1rem but we define it in inline styling */
  margin-top: var(--flow-space, 1rem);
}

.container {
  padding-inline: 2em;
  margin-inline: auto;
  max-width: 60rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  /* Added line */
  border: 0;
}

/* There two approaches */
/* 1. Add .sr-only class for skip-to-content link so only screen readers see it */
/* 2. Add another class for alls so anybody see by focusing with tab, otherwise hidden */
.skip-to-content {
  position: absolute;
  z-index: 9999;
  color: hsl( var(--clr-dark));
  background: hsl( var(--clr-white));
  padding: .5rem 1rem;
  border-bottom-right-radius: 1rem;
  transform: translateY(-100%);
  transition: transform .5s ease-in-out;
}

.skip-to-content:focus {
  transform: translateY(0);
}

.box {
  background-color: lightblue;
  padding: 3rem;
}

.call-to-action {
  --gap: 5rem;
  background-color: pink;
  padding: 2rem;
  border-radius: 1rem;
}

/* Colors */

.bg-dark {
  background-color: hsl(var(--clr-dark));
}

.bg-accent {
  background-color: hsl(var(--clr-light));
}

.bg-white {
  background-color: hsl(var(--clr-white));
}

.text-dark {
  color: hsl(var(--clr-dark));
}

.text-accent {
  color: hsl(var(--clr-light));
}

.text-white {
  color: hsl(var(--clr-white));
}

/* typograpy */

.ff-serif {
  font-family: var(--ff-serif);
}

.ff-sans-cond {
  font-family: var(--ff-sans-cond);
}

.ff-sans-normal {
  font-family: var(--ff-sans-normal);
}

.letter-spacing-1 {
  letter-spacing: 4.75px;
}

.letter-spacing-2 {
  letter-spacing: 2.7px;
}

.letter-spacing-3 {
  letter-spacing: 2.35px;
}

.uppercase {
  text-transform: uppercase;
}

.fs-900 {
  font-size: var(--fs-900);
}

.fs-800 {
  font-size: var(--fs-800);
}

.fs-700 {
  font-size: var(--fs-700);
}

.fs-600 {
  font-size: var(--fs-600);
}

.fs-500 {
  font-size: var(--fs-500);
}

.fs-400 {
  font-size: var(--fs-400);
}

.fs-300 {
  font-size: var(--fs-300);
}

.fs-200 {
  font-size: var(--fs-200);
}

.fs-900,
.fs-800,
.fs-700,
.fs-600 {
  line-height: 1.1;
}

.numbered-title {
  font-family: var(--ff-sans-cond);
  font-size: var(--fs-500);
  text-transform: uppercase;
  letter-spacing: 4.72px;
}

.numbered-title>span {
  margin-right: .5em;
  font-weight: 700;
  color: hsl(var(--clr-white) / .25);
}