/* ------------------- */
/* Custom properties   */
/* ------------------- */

* {
  /* brand foundation */
  --brand-hue: 242;
  --brand-saturation: 100%;
  --brand-lightness: 68%;

  --accent-hue: 30;
  --accent-saturation: 100%;
  --accent-lightness: 56%;

  /* light */
  --brand-light: hsl(
    var(--brand-hue) var(--brand-saturation) var(--brand-lightness)
  );
  --accent-light: hsl(
    var(--accent-hue) var(--accent-saturation) var(--accent-lightness)
  );
  --text1-light: hsl(var(--brand-hue) var(--brand-saturation) 10%);
  --text2-light: hsl(var(--brand-hue) 30% 30%);
  --surface1-light: hsl(var(--brand-hue) 25% 90%);
  --surface2-light: hsl(var(--brand-hue) 20% 99%);
  --surface3-light: hsl(var(--brand-hue) 20% 92%);
  --surface4-light: hsl(var(--brand-hue) 20% 85%);
  --surface-shadow-light: var(--brand-hue) 10% 20%;
  --shadow-strength-light: 0.1;

  /* dark */
  --brand-dark: hsl(
    var(--brand-hue) calc(var(--brand-saturation) / 2)
      calc(var(--brand-lightness) / 1.5)
  );
  --accent-dark: hsl(
    var(--accent-hue) calc(var(--accent-saturation) / 2)
      calc(var(--accent-lightness) / 1.5)
  );
  --text1-dark: hsl(var(--brand-hue) 15% 85%);
  --text2-dark: hsl(var(--brand-hue) 5% 65%);
  --surface1-dark: hsl(var(--brand-hue) 10% 10%);
  --surface2-dark: hsl(var(--brand-hue) 10% 15%);
  --surface3-dark: hsl(var(--brand-hue) 5% 20%);
  --surface4-dark: hsl(var(--brand-hue) 5% 25%);
  --surface-shadow-dark: var(--brand-hue) 50% 3%;
  --shadow-strength-dark: 0.5;

  /* dim */
  --brand-dim: hsl(
    var(--brand-hue) calc(var(--brand-saturation) / 1.25)
      calc(var(--brand-lightness) / 1.25)
  );
  --accent-dim: hsl(
    var(--accent-hue) calc(var(--accent-saturation) / 1.25)
      calc(var(--accent-lightness) / 1.25)
  );
  --text1-dim: hsl(var(--brand-hue) 15% 75%);
  --text2-dim: hsl(var(--brand-hue) 10% 61%);
  --surface1-dim: hsl(var(--brand-hue) 10% 20%);
  --surface2-dim: hsl(var(--brand-hue) 10% 25%);
  --surface3-dim: hsl(var(--brand-hue) 5% 30%);
  --surface4-dim: hsl(var(--brand-hue) 5% 35%);
  --surface-shadow-dim: var(--brand-hue) 30% 13%;
  --shadow-strength-dim: 0.2;
}

:root {
  /* colors */
  color-scheme: light;

  /* set defaults */
  --brand: var(--brand-light);
  --accent: var(--accent-light);
  --text1: var(--text1-light);
  --text2: var(--text2-light);
  --surface1: var(--surface1-light);
  --surface2: var(--surface2-light);
  --surface3: var(--surface3-light);
  --surface4: var(--surface4-light);
  --surface-shadow: var(--surface-shadow-light);
  --shadow-strength: var(--shadow-strength-light);

  /* font-sizes */
  --fs-900: clamp(5rem, 8vw + 1rem, 9.375rem);
  --fs-800: 3.5rem;
  --fs-700: 1.5rem;
  --fs-600: 1rem;
  --fs-500: 1rem;
  --fs-400: 0.9375rem;
  --fs-300: 1rem;
  --fs-200: 0.875rem;
  /* --header1: 1.25rem; */
  --header1: clamp(0.8rem, 0.4111rem + 1.2444vw, 1.25rem);
  --header2: 0.8125rem;
  --text-semi: 0.625rem;
  --text-reg: 0.625rem;

  /* font-families */
  --ff-serif: "Playfair Display", serif;
  --ff-sans-cond: "Barlow Condensed", sans-serif;
  --ff-sans-normal: "Roboto", sans-serif;
  --ff-poppins: "Poppins", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --brand: var(--brand-dark);
    --accent: var(--accent-dark);
    --text1: var(--text1-dark);
    --text2: var(--text2-dark);
    --surface1: var(--surface1-dark);
    --surface2: var(--surface2-dark);
    --surface3: var(--surface3-dark);
    --surface4: var(--surface4-dark);
    --surface-shadow: var(--surface-shadow-dark);
    --shadow-strength: var(--shadow-strength-dark);
  }
}

[color-scheme="light"] {
  color-scheme: light;

  --brand: var(--brand-light);
  --accent: var(--accent-light);
  --text1: var(--text1-light);
  --text2: var(--text2-light);
  --surface1: var(--surface1-light);
  --surface2: var(--surface2-light);
  --surface3: var(--surface3-light);
  --surface4: var(--surface4-light);
  --surface-shadow: var(--surface-shadow-light);
  --shadow-strength: var(--shadow-strength-light);
}

[color-scheme="dark"] {
  color-scheme: dark;

  --brand: var(--brand-dark);
  --accent: var(--accent-dark);
  --text1: var(--text1-dark);
  --text2: var(--text2-dark);
  --surface1: var(--surface1-dark);
  --surface2: var(--surface2-dark);
  --surface3: var(--surface3-dark);
  --surface4: var(--surface4-dark);
  --surface-shadow: var(--surface-shadow-dark);
  --shadow-strength: var(--shadow-strength-dark);
}

[color-scheme="dim"] {
  color-scheme: dark;

  --brand: var(--brand-dim);
  --accent: var(--accent-dim);
  --text1: var(--text1-dim);
  --text2: var(--text2-dim);
  --surface1: var(--surface1-dim);
  --surface2: var(--surface2-dim);
  --surface3: var(--surface3-dim);
  --surface4: var(--surface4-dim);
  --surface-shadow: var(--surface-shadow-dim);
  --shadow-strength: var(--shadow-strength-dim);
}

@media (min-width: 35em) {
  :root {
    --fs-800: 5rem;
    --fs-700: 2.5rem;
    --fs-600: 1.5rem;
    --fs-500: 1.25rem;
    --fs-400: 1rem;
  }
}

@media (min-width: 45em) {
  :root {
    /* font-sizes */
    --fs-800: 6.25rem;
    --fs-700: 3.5rem;
    --fs-600: 2rem;
    --fs-500: 1.75rem;
    --fs-400: 1.125rem;
  }
}

/* ------------------- */
/* CSS Reset   */
/* ------------------- */
html {
  block-size: 100%;
  background-color: var(--surface1);
  color: var(--text1);
}

/* Box sizing rules */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role="list"],
ol[role="list"] {
  list-style: none;
}

/* Set core root defaults */
html:focus-within {
  scroll-behavior: smooth;
}

/* Set core body defaults */
body {
  min-block-size: 100%;
  font-family: var(--ff-poppins);
  min-height: 100vh;
  text-rendering: optimizeSpeed;
  line-height: 1.5;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
}

/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

  *,
  *::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;
}

.flow > *:where(:not(:first-child)) {
  margin-top: var(--flow-space, 1rem);
}

.flow--space-small {
  --flow-space: 0.75rem;
}

.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;
}

.skip-to-content {
  position: absolute;
  z-index: 9999;
  background: hsl(var(--clr-white));
  color: hsl(var(--clr-dark));
  padding: 0.5em 1em;
  margin-inline: auto;
  transform: translateY(-100%);
  transition: transform 250ms ease-in;
}

.skip-to-content:focus {
  transform: translateY(0);
}

/* typography */

.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);
}
.ff-poppins {
  font-family: var(--ff-poppins);
}

.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);
}

.header1 {
  font-size: var(--header1);
  font-weight: 600;
}
.header2 {
  font-size: var(--header2);
  font-weight: 400;
}
.text-semi {
  font-size: var(--text-semi);
  font-weight: 600;
}
.text-reg {
  font-size: var(--text-reg);
  font-weight: 400;
}

.fs-900,
.fs-800,
.fs-700,
.fs-600 {
  line-height: 1.1;
}

/* ################################################### */

body {
  display: grid;
  place-items: center;
  background-image: linear-gradient(to left, #3378ff, #9442fe);
}
.container {
  background-color: var(--surface1);
  width: min(calc(100% - 2rem), 80rem);
  margin: auto;
  min-height: 90vh;
  border-radius: 24px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.8fr 9fr;
  grid-template-columns: auto 1fr;
  margin-block: 2rem;
}

.header {
  background-color: var(--brand);
  padding: 1.5rem;
  padding-bottom: 3rem;
  padding-right: 0;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.logo,
.nav-link {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo {
  color: #fff;
  text-decoration: none;
  text-transform: capitalize;
  letter-spacing: 1px;
}

.logo-text {
  font-size: 1.65rem;
  font-weight: 600;
}

.nav-link {
  text-decoration: none;
  color: #fff;
  text-transform: capitalize;
  padding: 1rem;
  border-radius: 100px 0 0 100px;
}

.nav-link.active {
  background-color: var(--surface1);
}

.nav-link > span:first-child {
  display: grid;
  place-items: center;
}

.primary-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.mob-indicator {
  display: none;
}

.primary-nav > a > * {
  pointer-events: none;
}

.primary-nav > a {
  position: relative;
}

.nav-link.active::before {
  content: "";
  position: absolute;
  width: 24px;
  aspect-ratio: 1;
  right: 0;
  top: -24px;
  background-image: radial-gradient(
    circle 24px at top left,
    #0000 98%,
    var(--surface1)
  );
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  width: 24px;
  aspect-ratio: 1;
  right: 0;
  bottom: -24px;
  background-image: radial-gradient(
    circle 24px at bottom left,
    #0000 98%,
    var(--surface1)
  );
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.primary-nav > a:last-of-type {
  margin-top: auto;
}

/* ##################################### */

.dashboard {
  padding: 1.5rem 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  row-gap: 1.5rem;
  column-gap: 1rem;
}

.dashboard > *:not(.grid-header, .slider) {
  box-shadow: 0px 2px 20px hsl(var(--surface-shadow) / var(--shadow-strength));
}

.slides > *:not(.indicators) {
  box-shadow: 0px 2px 20px hsl(var(--surface-shadow) / var(--shadow-strength));
}

.grid-header {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.search {
  flex: 1.5;
  background-color: var(--surface2);
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.4rem 1rem;
  border-radius: 100vmax;
  box-shadow: 0px 2px 20px hsl(var(--surface-shadow) / var(--shadow-strength));
}

.search input {
  width: 100%;
  background-color: transparent;
  border: 0;
  outline: 0;
}

.search input::placeholder {
  color: var(--text2);
  font-size: var(--header2);
}

.search svg {
  color: var(--brand);
  transform: translateY(2px);
}

.profile {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: end;
}

.profile svg {
  color: var(--brand);
}

.profile svg:first-child {
  margin-right: 2rem;
}

.profile .header2 {
  color: var(--text2);
  text-transform: capitalize;
}

.profile > img {
  width: 40px;
  aspect-ratio: 1;
  border-radius: 50%;
  margin-left: 0.5rem;
}
.slider {
  grid-column: span 3;
}
.slides {
  height: 100%;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.box {
  background-color: var(--surface2);
  padding: 1.4rem;
  border-radius: 12px;
}

.box > .header2 {
  margin-bottom: 1rem;
  color: var(--text2);
}

.box > div {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.box > div > .header1 {
  flex: 1;
}
.box > div > .header2 {
  color: var(--text2);
}

.box > div > svg {
  color: var(--brand);
}
.investing > div > svg {
  color: var(--accent);
}

.box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.box-header .header2 {
  color: var(--text2);
}
.box-header div {
  display: flex;
  align-items: center;
  color: var(--text2);
}

.currency {
  grid-row: span 2;
  background-color: var(--surface2);
  padding: 1.5rem;
  border-radius: 12px;
}

.currency .text-reg {
  color: var(--text2);
}

.col {
  display: flex;
  flex-direction: column;
}

.align-end {
  align-self: end;
}
.align-end span {
  margin-left: 0.5rem;
  margin-bottom: 0.5rem;
}
.row {
  display: flex;
  align-items: start;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--surface3);
}

.row:last-child {
  border: 0;
}
.up {
  color: var(--brand);
}
.down {
  color: var(--accent);
}

.row > div:first-child {
  display: flex;
  align-items: start;
  gap: 0.5rem;
  flex: 1;
}
.row > div:first-child svg {
  color: var(--brand);
}
.row > div:first-child > div {
  display: flex;
  flex-direction: column;
}

.row > .buy {
  display: flex;
  align-items: start;
  gap: 0.2rem;
}

/* ############################## */
.spending-summary {
  padding: 1.5rem;
  background-color: var(--surface2);
  border-radius: 12px;
  grid-column: span 2;
  grid-row: span 2;
}

.spending-summary picture,
.spending-summary img {
  width: 100%;
}

.chart-line {
  display: grid;
  min-height: 90%;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(4, 1fr);
  align-items: center;
}

.chart-line span {
  color: var(--text2);
}

.line {
  grid-column: 2 / -1;
  width: 100%;
  height: 1px;
  background-color: var(--surface3);
}

/* ####################################### */

.recent-transactions {
  padding: 1.5rem;
  background-color: var(--surface2);
  border-radius: 12px;
  grid-row: span 2;
}

.recent-align-center {
  display: flex;
  align-items: center;
}

.text-reg {
  color: var(--text2);
}

/* ################################ */

.spending-per-month {
  padding: 1.5rem;
  background-color: var(--surface2);
  border-radius: 12px;
  grid-row: span 3;
}

.spending-per-month .col .row {
  align-items: center;
}

.dot {
  display: block;
  width: 6px;
  aspect-ratio: 1;
  background-color: #fff;
  border-radius: 50%;
}

.row
  :is(.food, .credit, .petrol, .clothes):is(.food, .credit, .petrol, .clothes) {
  align-items: center;
}

.food > span {
  background-color: var(--brand);
}
.credit > span {
  background-color: var(--accent);
}
.petrol > span {
  background-color: var(--brand);
}
.clothes > span {
  background-color: var(--accent);
}

.charts-circle {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.chart-circle-1,
.chart-circle-2 {
  position: relative;
}

.chart-circle-2 {
  opacity: 0.2;
}

.chart-circle-1::before {
  content: "-$ 2625";
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  color: var(--text2);
}
.chart-circle-2::before {
  content: "+$ 5500";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  color: var(--text2);
}

.chart-circle-1 p {
  text-align: center;
  margin-bottom: 0.5rem;
}

/* ################################ */

.balance-overview {
  padding: 1.5rem;
  background-color: var(--surface2);
  border-radius: 12px;
  grid-row: span 2;
  grid-column: span 3;
}

.balance-overview .box-header {
  margin-bottom: 2rem;
}

/* ############################## */
.logo-mobile {
  display: none;
}

.indicators {
  display: none;
}

@media (max-width: 1300px) {
  .spending-per-month {
    grid-column: span 2;
    grid-row: span 2;
  }
  .spending-per-month > .chart-circle {
    display: flex;
    gap: 1rem;
  }
  .spending-per-month > .chart-circle > .col {
    flex: 1;
  }

  .balance-overview {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1100px) {
  .container {
    grid-template-columns: 1fr;
  }
  .header {
    flex-direction: row;
    padding: 1.5rem;
  }
  .primary-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .primary-nav > a:last-of-type {
    margin-left: auto;
  }
  .nav-link {
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.5rem 1rem;
    border-radius: 12px;
  }
  .nav-link.active {
    background-color: #fff;
    color: var(--brand);
  }
  .nav-link.active::before {
    content: "";
    display: none;
  }
  .nav-link.active::after {
    content: "";
    display: none;
  }
}

@media (max-width: 910px) {
  .primary-nav > a:last-child {
    margin-left: 0;
  }
  .spending-per-month {
    grid-column: 1 / -1;
    grid-row: span 2;
  }
}

@media (max-width: 700px) {
  html {
    scroll-behavior: smooth;
    scroll-padding-top: 6rem;
  }
  .container {
    width: 100%;
    padding-bottom: 4rem;
    margin: 0;
    border-radius: 0;
    padding-top: 4rem;
  }
  .logo {
    display: none;
  }
  .logo-mobile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    text-decoration: none;
    text-transform: capitalize;
    letter-spacing: 1px;
  }
  .logo-text-mob {
    font-size: 1.24rem;
    font-weight: 600;
  }

  .header {
    position: fixed;
    bottom: 0;
    width: 100%;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding: 0px;
    z-index: 100;
    background-color: var(--brand);
    transition: bottom 500ms ease-in-out;
  }

  .primary-nav {
    justify-content: space-between;
    margin-inline: 1rem;
    padding: 0.75rem 0;
    border-radius: 24px 24px 0 0;
  }

  .nav-link {
    padding: 0.5rem;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: background-color 250ms, color 350ms;
  }

  .nav-link::before,
  .nav-link::after {
    display: none;
  }

  .nav-link span:last-child {
    display: none;
  }

  .nav-link.active {
    background-color: #fff;
    color: var(--accent);
  }

  .nav-link svg {
    pointer-events: none;
  }
  .log-off.log-off.log-off {
    display: none;
  }
  .dashboard {
    padding: 2rem 0;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    row-gap: 1.5rem;
    scroll-padding-top: 3rem;
  }
  .dashboard > * {
    grid-column: 1;
  }

  .dashboard > *:not(.slider, .grid-header) {
    margin-inline: 1.5rem;
  }

  .grid-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--brand);
    padding: 0.5rem 1.5rem;
    z-index: 1000;
    flex-wrap: nowrap;
    box-shadow: 0px 2px 10px hsl(var(--surface-shadow) / var(--shadow-strength)),
      0px 4px 20px hsl(var(--surface-shadow) / var(--shadow-strength));
  }
  .search {
    flex: 1;
    background-color: var(--brand);
    box-shadow: none;
    padding: 0;
    margin-right: 0.5rem;
  }
  .search svg {
    margin-left: auto;
    transform-origin: right;
    transform: translateY(2px) scale(0.8);
  }
  .profile {
    flex: none;
  }
  .search svg,
  .profile svg {
    color: #fff;
  }
  .profile svg:first-child {
    transform: scale(0.8);
  }
  .profile p {
    display: none;
  }
  .search input {
    display: none;
  }
  .profile svg:first-child {
    margin-right: 0;
  }
  .slider {
    position: relative;
    overflow-x: auto;
    padding-block-end: 1.5rem;
  }

  .slides {
    width: 100%;
    height: 100%;
    padding: 1rem 0;
    grid-template-columns: none;

    grid-auto-flow: column;
    grid-auto-columns: 70%;
    padding-inline: 1.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    -ms-overflow-style: none; /* Hide scrollbar for IE and Edge */
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
  }
  .slides > *:not(.indicators) {
    box-shadow: 0px 2px 20px hsl(var(--surface-shadow) / var(--shadow-strength));
  }
  .slides > div {
    scroll-snap-align: center;
    scroll-snap-stop: always;
  }
  /* Hide scrollbar for Chrome, Safari and Opera */
  .slides::-webkit-scrollbar {
    display: none;
  }
  .indicators {
    position: absolute;
    top: 85%;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    gap: 1rem;
    z-index: 100;
  }
  .indicators a {
    width: 6px;
    aspect-ratio: 1;
    border-radius: 50%;
    background-color: var(--accent);
    opacity: 0.3;
  }
  .indicators a.active {
    opacity: 1;
  }

  .spending-per-month > .chart-circle {
    display: block;
  }
}

@media (max-width: 320px) {
  .nav-link {
    padding: 0.2rem;
  }
  .nav-link > span:first-child svg {
    transform: scale(0.8);
  }
}
