/* 
 *
 * ANCHOR: Global
------------------------------------------------*/
/* 
 *
 * / Components
------------------------------------------------*/
/* Breakpoints */
/* 368px, bigger phones */
/* 560px */
/* 800px */
/* 1008px, tablet vertical */
/* 1200px */
/* 1440px, desktop */
/* Animation easing curves */
:root {
  --ease-smooth: cubic-bezier(0.4, 0.0, 0.2, 1); /* Material Design standard */
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55); /* Bounce settle */
  --ease-gentle: cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Gentle ease in-out */
  --ease-flour-pour: cubic-bezier(0.33, 0.0, 0.2, 1); /* Faster start, gentle end */
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Global Styles */
body {
  font-family: "pinot-grigio-modern", sans-serif;
  color: var(--color-text);
  background: var(--color-page-bg);
  padding-top: var(--size-1000);
  min-height: 100vh;
  min-height: 100dvh;
  transition: background 0.2s var(--ease-smooth), color 0.2s var(--ease-smooth);
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* 
*
* ANCHOR: Header
------------------------------------------------*/
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: var(--size-100) 0;
}

.header__wrapper {
  display: flex;
  justify-content: center;
  text-align: center;
  gap: var(--size-300);
}

.ingredient {
  display: flex;
  font-family: "Lubaline", sans-serif;
  font-weight: 300;
  letter-spacing: 0.05em;
  flex-direction: column;
  align-items: center;
  padding: 0 var(--size-050);
}
.ingredient__container {
  font-size: var(--size-100);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--size-060);
}
.ingredient__circle {
  width: var(--size-400);
  height: var(--size-400);
  border-radius: 50%;
  display: block;
}
.ingredient__label {
  font-size: var(--size-100);
  letter-spacing: 0.01em;
}

/* 
*
* ANCHOR: Bakery
------------------------------------------------*/
.bakery-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: var(--size-600);
  gap: var(--size-050);
}

/* Bakery Ratio */
.bakery-ratio {
  font-family: "Lubaline", sans-serif;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.3;
  font-size: var(--size-400);
  color: var(--color-text);
  text-align: center;
  transition: color 0.2s var(--ease-smooth);
}
.bakery-ratio__separator {
  color: var(--color-text);
}

/* Bakery Selector */
.bakery {
  display: flex;
  justify-content: center;
  position: relative;
  font-family: "Lubaline", sans-serif;
  font-size: var(--size-900);
  z-index: 100;
}
.bakery__selector {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.bakery__current {
  font-family: "Lubaline", sans-serif;
  font-weight: 400;
  padding: 0 var(--size-400);
  line-height: 0.8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--size-100);
  font-size: var(--size-900);
  color: var(--color-text);
  border-radius: var(--size-500);
  cursor: pointer;
}
.bakery__icon {
  fill: var(--color-icon);
  transition: fill 0.3s var(--ease-smooth);
}
.bakery__overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s var(--ease-smooth);
}
.bakery__dropdown {
  width: 100%;
  max-height: 100vh;
  overflow-y: auto;
  z-index: 102;
  display: flex;
  gap: var(--size-060);
  flex-direction: column;
  align-items: center;
  position: relative;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.bakery__dropdown::-webkit-scrollbar {
  display: none;
}
.bakery__item {
  display: block;
  padding: var(--size-300) var(--size-400) var(--size-050) var(--size-400);
  cursor: pointer;
  background: var(--color-accent-1);
  color: var(--color-background-light);
  border-radius: var(--size-500);
  font-family: "Lubaline", sans-serif;
  font-weight: 400;
  font-size: var(--size-900);
  line-height: 0.8;
  text-align: center;
  /* Bakery selector stagger */
  opacity: 0;
  transform: translateY(-20px);
  animation: cascadeIn 0.4s var(--ease-smooth) forwards;
}
.bakery__item:nth-child(1) {
  animation-delay: 0.05s;
}
.bakery__item:nth-child(2) {
  animation-delay: 0.1s;
}
.bakery__item:nth-child(3) {
  animation-delay: 0.15s;
}
.bakery__item:nth-child(4) {
  animation-delay: 0.2s;
}
.bakery__item:nth-child(5) {
  animation-delay: 0.25s;
}
.bakery__item:nth-child(6) {
  animation-delay: 0.3s;
}
.bakery__item:nth-child(7) {
  animation-delay: 0.35s;
}
.bakery__item:nth-child(8) {
  animation-delay: 0.4s;
}
.bakery__item:nth-child(9) {
  animation-delay: 0.45s;
}
.bakery__item:nth-child(10) {
  animation-delay: 0.5s;
}
.bakery__item:nth-child(11) {
  animation-delay: 0.55s;
}
.bakery__item:nth-child(12) {
  animation-delay: 0.6s;
}
.bakery__item:nth-child(13) {
  animation-delay: 0.65s;
}
.bakery__item:nth-child(14) {
  animation-delay: 0.7s;
}
.bakery__item:nth-child(15) {
  animation-delay: 0.75s;
}
.bakery__item:first-child {
  margin-top: 0;
}
.bakery__item--active {
  background: var(--color-background-dark);
  color: var(--color-background-light);
  box-shadow: inset -0.1875rem -0.1875rem 0.375rem var(--color-background-highlight), inset 0.1875rem 0.1875rem 0.3125rem var(--color-background-shadow);
}

/* Light mode */
body.view-calculator .bakery__item {
  background: var(--color-accent-2);
  color: var(--color-background-dark);
}
body.view-calculator .bakery__item--active {
  background: var(--color-background-light);
  color: var(--color-background-dark);
  box-shadow: inset -0.1875rem -0.1875rem 0.375rem var(--color-background-highlight), inset 0.1875rem 0.1875rem 0.3125rem var(--color-background-shadow);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes cascadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* 
*
* ANCHOR: Navigation
------------------------------------------------*/
.nav {
  padding: 0;
  margin-bottom: var(--size-800);
  position: relative;
  z-index: 100;
}
.nav__list {
  display: grid;
  grid-template-columns: 1fr;
  justify-content: center;
  gap: var(--size-050);
  width: 100%;
  margin: 0;
  border-top: 1px solid var(--color-text);
  border-bottom: 1px solid var(--color-text);
}
@media screen and (min-width: 35rem) {
  .nav__list {
    grid-template-columns: repeat(3, auto);
    gap: 0;
  }
}
.nav__item a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--size-080);
  padding: var(--size-010) var(--size-100);
  text-align: center;
  text-decoration: none;
  font-family: "pinot-grigio-modern", sans-serif;
  font-weight: 300;
  color: var(--color-text);
  line-height: 1;
  font-size: var(--size-200);
  letter-spacing: 0.03em;
  transition: all 0.3s var(--ease-gentle);
}
.nav__item a:focus {
  outline: none;
}
.nav__item a.active {
  background: var(--color-nav-active-bg);
  color: var(--color-nav-active-text);
}

.view {
  position: relative;
  z-index: 1;
}

/* 
*
* ANCHOR: View 1: Ratio Visualizer
------------------------------------------------*/
.visualizer {
  position: fixed;
  left: var(--size-400);
  right: var(--size-400);
  top: 0px;
  bottom: 0px;
  overflow: hidden;
  background: transparent;
  border: none;
  border-radius: var(--size-100);
  z-index: 0;
  pointer-events: none;
  container-type: inline-size;
}
.visualizer__circle {
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  will-change: transform;
  overflow: hidden;
  clip-path: circle(50%);
  width: calc(var(--circle-ratio) * 20cqi);
  height: calc(var(--circle-ratio) * 20cqi);
}
@media screen and (min-width: 50rem) {
  .visualizer__circle {
    width: calc(var(--circle-ratio) * 10cqi);
    height: calc(var(--circle-ratio) * 10cqi);
  }
}
.visualizer__circle-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
  /* Circular Rotation */
  animation: textureRotate 120s linear infinite;
}

@keyframes textureRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
/* 
*
* ANCHOR: View 2: Ingredient Calculator
------------------------------------------------*/
.calculator-wrapper {
  position: relative;
  z-index: 1;
}
.calculator-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--size-200);
  padding: 0 var(--size-200);
}
@media screen and (min-width: 35rem) {
  .calculator-container {
    grid-template-columns: 1fr 1fr;
    gap: var(--size-400);
  }
}
@media screen and (min-width: 75rem) {
  .calculator-container {
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--size-300);
  }
}

.ingredient-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s var(--ease-gentle);
}

.ingredient-label {
  font-family: "Lubaline", sans-serif;
  font-weight: 300;
  text-transform: capitalize;
  letter-spacing: 0.01em;
  font-size: var(--size-300);
}
.ingredient-label[data-ingredient=flour] {
  color: var(--color-flour);
}
.ingredient-label[data-ingredient=liquid] {
  color: var(--color-liquid);
}
.ingredient-label[data-ingredient=egg] {
  color: var(--color-egg);
}
.ingredient-label[data-ingredient=fat] {
  color: var(--color-fat-dark);
}
.ingredient-label[data-ingredient=sugar] {
  color: var(--color-sugar);
}

.ingredient-input {
  display: flex;
  align-items: center;
}
.ingredient-input input {
  border: none;
  background: var(--color-background-light);
  border-radius: var(--size-300);
  box-shadow: inset -0.1875rem -0.1875rem 0.4375rem var(--color-background-highlight), inset 0.1875rem 0.1875rem 0.3125rem var(--color-background-shadow);
  font-size: var(--size-800);
  text-align: center;
  font-family: "pinot-grigio-modern", sans-serif;
  font-weight: 300;
  color: var(--color-text);
  line-height: 1;
  width: 100%;
  padding: 0;
  margin: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
       appearance: none;
  transition: all 0.3s var(--ease-gentle);
  /* Remove number input spinners */
  /* Firefox */
}
.ingredient-input input::-webkit-outer-spin-button, .ingredient-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.ingredient-input input[type=number] {
  -moz-appearance: textfield;
}
.ingredient-input input:focus {
  outline: none;
}

/* 
*
* ANCHOR: View 3: Recipes
------------------------------------------------*/
.recipe__wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--size-400);
  position: relative;
  z-index: 1;
  margin: 0 var(--size-200);
}
@media screen and (min-width: 35rem) {
  .recipe__wrapper {
    grid-template-columns: 1fr 1fr;
    gap: var(--size-600);
  }
}
.recipe__container {
  font-family: "pinot-grigio-modern", sans-serif;
  border-radius: var(--size-200);
  position: relative;
  display: flex;
  flex-direction: column;
}
.recipe__step-numbers {
  left: var(--size-300);
  display: flex;
  gap: var(--size-050);
  padding-bottom: var(--size-090);
}
.recipe__step-number {
  width: var(--size-300);
  height: var(--size-300);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #811b51;
  background: var(--color-background-dark);
  font-weight: 300;
  font-family: "pinot-grigio-modern", sans-serif;
  font-size: var(--size-200);
  box-shadow: inset -0.0625rem -0.0625rem 0.125rem var(--color-background-highlight), inset 0.0625rem 0.0625rem 0.1rem var(--color-background-shadow);
  transition: all 0.3s var(--ease-gentle);
}
.recipe__step-number--active {
  box-shadow: -0.0625rem -0.0625rem 0.125rem var(--color-background-highlight), 0.0625rem 0.0625rem 0.1rem var(--color-background-shadow);
  color: var(--color-text);
}
.recipe__step {
  font-size: var(--size-400);
  line-height: 1.12;
  letter-spacing: 0.01em;
  margin-top: 0;
  margin-bottom: var(--size-200);
  font-weight: 300;
  color: var(--color-accent-2);
}
@media screen and (min-width: 35rem) {
  .recipe__step {
    margin-bottom: auto;
  }
}
.recipe__step .ingredient-word {
  font-family: "Lubaline", sans-serif;
  font-weight: 300;
  letter-spacing: 0.02em;
  transition: all 0.2s var(--ease-gentle);
  text-transform: uppercase;
}

/* 
*
* ANCHOR: Footer
------------------------------------------------*/
.footer {
  position: relative;
  z-index: 100;
  margin-top: var(--size-800);
  margin-bottom: var(--size-200);
}
.footer__wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: var(--size-020);
  margin: 0 auto;
}
.footer__container {
  font-weight: 300;
  color: var(--color-text);
  transition: color 0.2s var(--ease-smooth);
}
.footer__container--title {
  font-family: "Lubaline", sans-serif;
  font-size: var(--size-100);
  letter-spacing: 0.02em;
}
.footer__container--credit {
  font-family: "pinot-grigio-modern", sans-serif;
  font-weight: 300;
  font-size: var(--size-080);
  letter-spacing: 0.03em;
}

/* Ratio Visualizer Footer*/
.view-visualizer .footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  margin-bottom: var(--size-200);
  z-index: -1;
}
.view-visualizer .footer__container {
  color: var(--color-accent-2);
}