/* ─── Override main padding for full-bleed results ──────── */

main:has(.results-page) {
  padding: 2rem 0 0;
}

/* ─── Keyframes ─────────────────────────────────────────── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes expandLine {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

@keyframes stepPing {
  0%   { transform: scale(1);   opacity: 0.7; }
  100% { transform: scale(2.2); opacity: 0; }
}

@keyframes tagPop {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.75); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* ─── Entrance ──────────────────────────────────────────── */

.fade-in {
  opacity: 0;
  animation: fadeUp 0.55s ease forwards;
}

.fade-in:nth-child(1) { animation-delay: 0.05s; }
.fade-in:nth-child(2) { animation-delay: 0.18s; }
.fade-in:nth-child(3) { animation-delay: 0.32s; }
.fade-in:nth-child(4) { animation-delay: 0.46s; }
.fade-in:nth-child(5) { animation-delay: 0.60s; }
.fade-in:nth-child(6) { animation-delay: 0.72s; }

/* ─── Micro label ───────────────────────────────────────── */

.micro-label {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-blue);
  display: block;
}

/* ─── Section rule dividers ─────────────────────────────── */

.section-rule {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-rule__line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-blue), transparent);
  transform-origin: center;
  transform: scaleX(0);
  opacity: 0;
  animation: expandLine 0.7s ease forwards;
}

.section-rule__line--delayed { animation-delay: 0.45s; }
.section-rule__line--routine { animation-delay: 0.58s; }

.ingredients-heading {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--color-navy);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.ingredients-heading--large {
  font-size: 1.15rem;
}

/* ─── Page shell ────────────────────────────────────────── */

.results-page {
  max-width: 42rem;
  margin: 2rem auto;
  padding: 3rem 2rem 4.5rem;
  border: 4px solid var(--color-blue);
  border-radius: 1rem;
  box-shadow: 0 0 50px rgba(123,158,168,0.12), inset 0 1px 0 rgba(46,61,79,0.04);
}

/* ─── Heading ───────────────────────────────────────────── */

.results-page__heading {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 400;
  text-align: center;
  margin-bottom: 0.45rem;
  line-height: 1.35;
  background: linear-gradient(
    90deg,
    var(--color-navy)  30%,
    var(--color-blush) 50%,
    var(--color-navy)  70%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 1.8s ease forwards;
  animation-delay: 0.3s;
}

.results-page__subheading {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-blue);
  text-align: center;
  letter-spacing: 0.04em;
  margin-bottom: 3rem;
}

/* ─── Skin profile ──────────────────────────────────────── */

.results-profile {
  background-color: var(--color-sage);
  border-radius: 0.875rem;
  padding: 1.4rem 1.6rem;
  margin-bottom: 3rem;
}

.results-profile__label {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-blue);
  display: block;
  margin-bottom: 0.5rem;
}

.results-profile__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.7rem 0 0.95rem;
}

.results-tag {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-off-white);
  background-color: var(--color-blue);
  border-radius: 2rem;
  padding: 0.25rem 0.85rem;
  opacity: 0;
  animation: tagPop 0.35s ease forwards;
}

.results-tag:nth-child(1) { animation-delay: 0.25s; }
.results-tag:nth-child(2) { animation-delay: 0.35s; }
.results-tag:nth-child(3) { animation-delay: 0.45s; }
.results-tag:nth-child(4) { animation-delay: 0.55s; }

.results-tag--concern {
  background-color: var(--color-blush);
  color: var(--color-navy);
}

.results-profile__description {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-navy);
  opacity: 0.9;
  line-height: 1.75;
}

/* ─── Ingredient cards ──────────────────────────────────── */

.results-ingredients {
  margin-bottom: 3rem;
}

.results-ingredient {
  background-color: rgba(214,232,226,0.3);
  border: 1px solid rgba(214,232,226,0.8);
  border-left: 3px solid var(--color-blush);
  border-radius: 0.75rem;
  margin-bottom: 0.55rem;
  overflow: hidden;
  opacity: 0;
  animation: fadeUp 0.45s ease forwards;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.results-ingredient:nth-of-type(1) { animation-delay: 0.38s; }
.results-ingredient:nth-of-type(2) { animation-delay: 0.50s; }
.results-ingredient:nth-of-type(3) { animation-delay: 0.62s; }
.results-ingredient:nth-of-type(4) { animation-delay: 0.74s; }

.results-ingredient:hover {
  transform: translateY(-2px);
  border-color: var(--color-blush);
  box-shadow: 0 6px 24px rgba(232,206,200,0.12);
}

details[open].results-ingredient {
  border-color: var(--color-blush);
  box-shadow: 0 4px 20px rgba(232,206,200,0.1);
  transform: none;
}

.results-ingredient__summary {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.15rem 1.2rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  outline: none;
}

.results-ingredient__summary::-webkit-details-marker { display: none; }
.results-ingredient__summary::marker { display: none; }
.results-ingredient__summary:active { opacity: 0.75; transition: opacity 0.1s; }

.results-ingredient__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--color-navy);
  white-space: nowrap;
  min-width: 9.5rem;
}

.results-ingredient__one-liner {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--color-navy);
  opacity: 0.8;
  flex: 1;
  line-height: 1.45;
}

.results-ingredient__arrow {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 1.5px solid var(--color-blue);
  border-bottom: 1.5px solid var(--color-blue);
  transform: rotate(45deg) translateY(-2px);
  flex-shrink: 0;
  opacity: 0.65;
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1), opacity 0.2s ease;
}

details[open] .results-ingredient__arrow {
  transform: rotate(-135deg) translateY(-2px);
  opacity: 1;
}

.results-ingredient__body {
  overflow: hidden;
  transition: max-height 0.38s cubic-bezier(0.4,0,0.2,1), opacity 0.3s ease;
  border-top: 1px solid rgba(214,232,226,0.6);
}

.results-ingredient__body-inner {
  padding: 0.95rem 1.2rem 1.15rem;
}

.results-ingredient__detail {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--color-navy);
  opacity: 0.8;
  line-height: 1.8;
  margin-bottom: 0.85rem;
}

.results-ingredient__for-you {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--color-navy);
  opacity: 0.6;
}

.results-ingredient__for-you::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--color-blue);
  flex-shrink: 0;
  opacity: 1;
  animation: pulse 2.5s ease-in-out infinite;
}

/* ─── Routine sections ──────────────────────────────────── */

.results-section {
  border-radius: 0.875rem;
  padding: 1.6rem 1.75rem;
  margin-bottom: 1rem;
}

.results-section--morning {
  background-color: color-mix(in srgb, var(--color-blush) 18%, var(--color-off-white));
  border: 1px solid color-mix(in srgb, var(--color-blush) 35%, var(--color-off-white));
}

.results-section--evening {
  background-color: var(--color-sage);
  border: 1px solid rgba(123,158,168,0.35);
}

/* ─── Period heading ────────────────────────────────────── */

.results-period {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  margin-bottom: 1.1rem;
  padding-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.results-section--morning .results-period {
  color: var(--color-navy);
  border-bottom: 1px solid rgba(46,61,79,0.12);
}

.results-section--evening .results-period {
  color: var(--color-navy);
  border-bottom: 1px solid rgba(123,158,168,0.25);
}

.results-period__icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  opacity: 0.85;
}

.results-products {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

/* ─── Product step cards (expandable) ───────────────────── */

.results-product {
  border-radius: 0.65rem;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.results-product--morning {
  background-color: rgba(255,255,255,0.75);
  border: 1px solid rgba(232,206,200,0.5);
}

.results-product--morning:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 18px rgba(0,0,0,0.3);
}

.results-product--evening {
  background-color: rgba(255,255,255,0.6);
  border: 1px solid rgba(123,158,168,0.3);
}

.results-product--evening:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 18px rgba(0,0,0,0.35);
}

details[open].results-product { transform: none; }

/* Product summary row */
.results-product__summary {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.15rem 1.1rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  outline: none;
}

.results-product__summary::-webkit-details-marker { display: none; }
.results-product__summary::marker { display: none; }
.results-product__summary:active { opacity: 0.75; transition: opacity 0.1s; }

/* Step circle */
.results-product__step {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  border: 1.5px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
}

.results-product__step::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 1.5px solid;
  opacity: 0;
  animation: stepPing 1s ease forwards;
}

.results-product--morning .results-product__step {
  color: var(--color-blue);
  border-color: rgba(123,158,168,0.5);
  background-color: rgba(123,158,168,0.08);
}

.results-product--morning .results-product__step::after {
  border-color: var(--color-blue);
}

.results-product--evening .results-product__step {
  color: var(--color-blue);
  border-color: rgba(123,158,168,0.45);
  background-color: rgba(123,158,168,0.08);
}

.results-product--evening .results-product__step::after {
  border-color: var(--color-blue);
}

.results-product:nth-child(1) .results-product__step::after { animation-delay: 0.7s; }
.results-product:nth-child(2) .results-product__step::after { animation-delay: 0.9s; }
.results-product:nth-child(3) .results-product__step::after { animation-delay: 1.1s; }

/* Product text */
.results-product__text { flex: 1; }

.results-product__header {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin-bottom: 0.2rem;
}

.results-product__brand {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-blue);
  margin-bottom: 0.1rem;
}

.results-product__name {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-navy);
}

.results-product__category {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.results-product--morning .results-product__category {
  color: var(--color-blue);
  opacity: 0.8;
}

.results-product--evening .results-product__category {
  color: var(--color-blue);
}

.results-product__why {
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.5;
}

.results-product--morning .results-product__why {
  color: var(--color-navy);
  opacity: 0.65;
}

.results-product--evening .results-product__why {
  color: var(--color-blue);
}

/* Arrow */
.results-product__arrow {
  width: 0.5rem;
  height: 0.5rem;
  border-right: 1.5px solid;
  border-bottom: 1.5px solid;
  transform: rotate(45deg) translateY(-2px);
  flex-shrink: 0;
  opacity: 0.45;
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1), opacity 0.2s ease;
}

.results-product--morning .results-product__arrow { border-color: var(--color-blue); }
.results-product--evening .results-product__arrow { border-color: var(--color-blue); }

details[open] .results-product__arrow {
  transform: rotate(-135deg) translateY(-2px);
  opacity: 0.8;
}

/* Expanded educational body */
.results-product__body {
  overflow: hidden;
  transition: max-height 0.38s cubic-bezier(0.4,0,0.2,1), opacity 0.3s ease;
}

.results-product--morning .results-product__body {
  border-top: 1px solid rgba(123,158,168,0.2);
}

.results-product--evening .results-product__body {
  border-top: 1px solid rgba(123,158,168,0.15);
}

.results-product__body-inner {
  padding: 0.9rem 1.1rem 1rem 3.5rem;
}

.results-product__timing {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  display: block;
  margin-bottom: 0.5rem;
}

.results-product--morning .results-product__timing {
  color: var(--color-blue);
  opacity: 0.8;
}

.results-product--evening .results-product__timing {
  color: var(--color-blue);
  opacity: 0.75;
}

.results-product__detail {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.75;
  margin-bottom: 0.75rem;
  color: var(--color-navy);
  opacity: 0.75;
}

.results-product__benefit {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-blue);
}

.results-product__benefit::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--color-blue);
  flex-shrink: 0;
}

/* ─── Actions ───────────────────────────────────────────── */

.results-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2.75rem;
}

.quiz-btn {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border-radius: 2rem;
  padding: 0.75rem 2.25rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.quiz-btn--primary {
  color: var(--color-navy-deep);
  background-color: var(--color-blue);
  border: 1.5px solid var(--color-blue);
}

.quiz-btn--primary:hover {
  background-color: var(--color-sage);
  border-color: var(--color-sage);
  box-shadow: 0 4px 20px rgba(214,232,226,0.2);
}

.quiz-btn--ghost {
  color: var(--color-navy);
  background: transparent;
  border: 1.5px solid rgba(46,61,79,0.25);
}

.quiz-btn--ghost:hover {
  border-color: var(--color-blue);
  color: var(--color-blue);
}

/* ─── Prototype Notice ──────────────────────────────────── */

.results-prototype-notice {
  max-width: 36rem;
  margin: 0 auto 2rem;
  padding: 0.85rem 1.25rem;
  border-left: 3px solid var(--color-blue);
  background-color: rgba(214,232,226,0.4);
  border-radius: 0 0.5rem 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.results-prototype-notice__icon {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  color: var(--color-blue);
}

.results-prototype-notice__text {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--color-navy);
  opacity: 0.9;
  margin: 0;
}

/* ─── Mobile ────────────────────────────────────────────── */

@media (max-width: 640px) {
  .results-page {
    margin: 1rem;
    padding: 2rem 1.25rem 3rem;
  }

  .results-page__heading {
    font-size: 1.45rem;
  }

  .section-rule__line {
    display: none;
  }

  .section-rule {
    justify-content: center;
  }

  .ingredients-heading {
    white-space: normal;
    text-align: center;
    font-size: 0.9rem;
  }

  .ingredients-heading--large {
    font-size: 0.95rem;
  }

  /* ─── Ingredient cards ──────────────────────────────────── */

  .results-ingredient__summary {
    flex-wrap: wrap;
    row-gap: 0.3rem;
  }

  .results-ingredient__name {
    min-width: unset;
    white-space: normal;
  }

  .results-ingredient__one-liner {
    flex: 0 0 100%;
  }

  .results-ingredient__arrow {
    align-self: flex-start;
    margin-top: 0.15rem;
  }

  /* ─── Routine sections ──────────────────────────────────── */

  .results-section {
    padding: 1.25rem 1rem;
  }

  .results-product__summary {
    gap: 0.6rem;
    padding: 1rem 0.85rem;
  }

  .results-product__step {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.55rem;
  }

  .results-product__header {
    flex-wrap: wrap;
    gap: 0.2rem 0.4rem;
  }

  .results-product__name {
    font-size: 0.95rem;
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
  }

  .results-product__brand {
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .results-product__body-inner {
    padding: 0.85rem 0.85rem 0.9rem 1rem;
  }

  .results-product__why,
  .results-product__detail {
    overflow-wrap: break-word;
    word-break: break-word;
  }
}
