:root {
  color: #000;
  background: #fff;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-synthesis: none;
  --orange: #ff8200;
  --green: #23c268;
  --yellow: #f2ee52;
  --pink: #f062a6;
  --grey: #e4e4e5;
  --light-grey: #f2f2f2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  height: 62px;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgb(255 255 255 / 94%);
}

.course-logo {
  display: flex;
  align-items: center;
  color: inherit;
  font-size: clamp(1.7rem, 3.2vw, 2rem);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.course-logo:hover {
  color: #8c8c8c;
}

.logo-shape {
  position: relative;
  width: 0.6em;
  height: 0.6em;
  margin: 0 0.34em;
  flex: 0 0 auto;
}

.shape {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: logo-shape-cycle 6s infinite;
}

.shape.triangle {
  background: var(--orange);
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.shape.circle {
  border-radius: 50%;
  background: var(--green);
  animation-delay: 2s;
}

.shape.square {
  background: var(--pink);
  animation-delay: 4s;
}

.logo-shape-b .triangle {
  animation-delay: -2s;
}

.logo-shape-b .circle {
  animation-delay: 0s;
}

.logo-shape-b .square {
  animation-delay: 2s;
}

@keyframes logo-shape-cycle {
  0%,
  33.33% {
    opacity: 1;
  }
  33.34%,
  100% {
    opacity: 0;
  }
}

.header-label,
.eyebrow,
.step,
.table-cell > span,
.content-cell label > span {
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

main {
  width: min(100% - 48px, 72rem);
  margin: 0 auto;
  padding: 118px 0 96px;
}

.intro {
  margin-bottom: 3.5rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 900px;
  margin-bottom: 1.6rem;
  font-size: clamp(2.4rem, 5.5vw, 4.5rem);
  line-height: 0.88;
  letter-spacing: -0.03em;
}

h2 {
  margin-bottom: 0;
  font-size: 2rem;
  line-height: 1.1;
}

h3 {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1;
}

.eyebrow,
.step {
  margin-bottom: 0.25rem;
}

.intro-copy {
  max-width: 52rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.intro-copy p {
  margin-bottom: 0;
}

.generator,
.result-section,
.resources-section {
  border: 2px solid #000;
  border-radius: 18px;
  padding: 2rem;
}

.generator {
  background: #fff;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.step-marker {
  width: 3.2rem;
  height: 3.2rem;
  padding-top: 0.65rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--green);
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  font-size: 1.5rem;
  font-weight: 700;
}

.step-marker-two {
  padding-top: 0;
  border-radius: 50%;
  background: var(--yellow);
  clip-path: none;
}

.step-marker-three {
  padding-top: 0;
  background: var(--pink);
  clip-path: none;
}

.ingredient-table {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.ingredient-wordmark {
  grid-column: 1 / -1;
  min-height: 66px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 0;
  font-size: clamp(0.95rem, 1.6vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 0.7;
}

.ingredient-wordmark > div {
  min-width: 0;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
}

.ingredient-wordmark > div + div {
  border-left: 0;
}

.ingredient-wordmark > div:nth-child(1) {
  border-radius: 999px;
  background: var(--green);
}

.ingredient-wordmark > div:nth-child(2) {
  background: var(--green);
}

.ingredient-wordmark > div:nth-child(3) {
  border-radius: 999px;
  background: var(--green);
}

.ingredient-wordmark .wordmark-shape {
  display: none;
}

.wordmark-shape {
  width: 0.58em;
  height: 0.58em;
  display: block;
  flex: 0 0 auto;
}

.wordmark-square {
  background: var(--pink);
}

.wordmark-triangle {
  background: var(--orange);
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.wordmark-circle {
  border-radius: 50%;
  background: var(--green);
}

.ingredient-rows {
  display: contents;
}

.ingredient-row {
  position: relative;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.row-number {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 0.75rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  transform: translateY(-50%);
}

.ingredient-row:nth-child(even) .row-number {
  border-radius: 0;
}

.ingredient-row:nth-child(4n + 1) .row-number {
  background: var(--green);
}

.ingredient-row:nth-child(4n + 2) .row-number {
  background: var(--green);
}

.ingredient-row:nth-child(4n + 3) .row-number {
  background: var(--green);
}

.ingredient-row:nth-child(4n + 4) .row-number {
  background: var(--green);
}

.ingredient-row + .ingredient-row {
  border-top: 0;
}

.table-cell {
  position: relative;
  min-width: 0;
  padding: 1rem;
  display: block;
}

.table-cell + .table-cell {
  border-left: 0;
}

.aesthetic-cell {
  padding-left: 3.4rem;
}

.table-cell > span,
.content-cell label > span {
  display: block;
  margin-bottom: 0.4rem;
}

.table-cell input,
.table-cell select {
  width: 100%;
  min-width: 0;
  height: 2.75rem;
  border: 2px solid #000;
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  background: #fff;
  outline: 0;
  font-size: 0.88rem;
  font-weight: 700;
}

.table-cell select {
  appearance: none;
  padding-right: 3rem;
  background-position: right 0.55rem center;
  background-repeat: no-repeat;
  background-size: 1.65rem;
}

.table-cell .composition-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='12' fill='%2323c268'/%3E%3Cpath d='m7.5 9.5 4.5 5 4.5-5' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.table-cell .content-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect width='24' height='24' fill='%2323c268'/%3E%3Cpath d='m7.5 9.5 4.5 5 4.5-5' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.table-cell input:focus,
.table-cell select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px var(--green);
}

.content-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.6rem;
}

.content-cell label {
  min-width: 0;
}

.remove-row-button {
  width: 2.1rem;
  height: 2.1rem;
  border: 0;
  margin-bottom: 0.3rem;
  border-radius: 50%;
  background: var(--light-grey);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
}

.remove-row-button:hover:not(:disabled) {
  background: var(--pink);
}

.remove-row-button:disabled {
  visibility: hidden;
}

.table-controls {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.add-row-button {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  background: var(--light-grey);
  font-weight: 700;
}

.add-row-button:hover:not(:disabled) {
  background: var(--green);
}

.add-row-button:disabled {
  color: #757575;
  cursor: not-allowed;
}

.result-section {
  margin-top: 2rem;
}

.resources-section {
  margin-top: 2rem;
}

.resource-links {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.resource-link {
  width: fit-content;
  min-height: 0;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-radius: 999px;
  background: var(--grey);
  color: inherit;
  text-decoration: none;
}

.resource-link:hover {
  background: var(--pink);
}

.resource-link strong,
.resource-link small {
  display: block;
}

.resource-link strong {
  font-size: 1.05rem;
}

.resource-link small {
  margin-top: 0.25rem;
  font-size: 0.78rem;
}

.resource-link svg {
  width: 1.35rem;
  flex: 0 0 auto;
  fill: currentColor;
}

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.result-actions,
.timer-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.randomize-button,
.download-button,
.clear-button,
.timer-button {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.1rem;
  background: var(--grey);
  font-weight: 700;
}

.download-button {
  background: var(--light-grey);
}

.clear-button {
  background: transparent;
  text-decoration: underline;
}

.randomize-button span,
.download-button span {
  font-size: 1.25rem;
  line-height: 1;
}

.download-button svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
}

.randomize-button:hover:not(:disabled),
.timer-button:hover {
  background: var(--yellow);
}

.download-button:hover:not(:disabled) {
  background: var(--yellow);
}

.randomize-button:disabled,
.download-button:disabled,
.clear-button:disabled {
  color: #757575;
  cursor: not-allowed;
}

.result-status {
  margin: 1.5rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--light-grey);
  font-size: 0.85rem;
}

.study-list {
  margin-top: 1.5rem;
  display: grid;
  gap: 1rem;
}

.study-set {
  padding: 1.2rem;
  overflow-x: auto;
  border-radius: 12px;
  background: var(--light-grey);
}

.study-created {
  display: block;
  font-size: inherit;
  font-weight: 700;
}

.timer-output {
  min-width: 4.5rem;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

.timer-button {
  padding: 0.6rem 0.85rem;
  background: #fff;
  font-size: 0.85rem;
}

.timer-button.is-running {
  background: var(--yellow);
}

.result-cards {
  margin-top: 0;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.75rem;
}

.result-cards .timer-controls {
  margin-left: auto;
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

.result-number,
.result-pill {
  font-size: clamp(0.95rem, 1.6vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 0.98;
}

.result-number {
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #c8c8c9;
}

.result-pill {
  width: fit-content;
  max-width: 100%;
  min-height: 0;
  padding: 0.7rem 1rem;
  white-space: nowrap;
}

.aesthetic-result {
  border-radius: 999px;
  background: var(--yellow);
}

.date-result {
  border-radius: 999px;
  background: #b8b8b8;
}

.composition-result {
  background: var(--yellow);
}

.content-result {
  border-radius: 999px;
  background: var(--yellow);
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .header-label {
    display: none;
  }

  .site-header {
    padding-inline: 1.25rem;
  }

  main {
    width: min(100% - 24px, 72rem);
    padding-top: 96px;
  }

  .intro-copy {
    grid-template-columns: 1fr;
  }

  .generator,
  .result-section,
  .resources-section {
    padding: 1.1rem;
    border-radius: 12px;
  }

  .resource-links {
    grid-template-columns: 1fr;
  }

  .ingredient-wordmark {
    min-height: 0;
    font-size: clamp(0.85rem, 3vw, 1.2rem);
  }

  .ingredient-wordmark > div {
    padding: 0.7rem 0.65rem;
  }

  .result-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-actions {
    width: 100%;
  }

  .randomize-button,
  .download-button,
  .clear-button {
    flex: 1;
    justify-content: center;
  }

  .result-cards .timer-controls {
    margin-left: 0;
  }
}

@media (max-width: 520px) {
  .ingredient-table {
    display: block;
  }

  .ingredient-wordmark {
    display: none;
  }

  .ingredient-row {
    display: block;
  }

  .row-number {
    top: 1rem;
    transform: none;
  }

  .ingredient-row + .ingredient-row {
    border-top: 0;
  }

  .table-cell + .table-cell {
    border-top: 0;
    border-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shape {
    animation: none;
  }

  .shape.triangle {
    opacity: 1;
  }
}
