/* ========================================
   Rate My Portfolio
   ======================================== */
.rt {
  min-height: 100%;
  display: flex;
  justify-content: center;
  padding: 9rem var(--gutter) var(--space-xl);
  background: #000;
  position: relative;
  z-index: 1;
}

.rt [hidden] { display: none !important; }

.rt__form,
.rt__done {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: rtIn 0.9s var(--ease) both;
}

@keyframes rtIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.rt__eyebrow {
  text-align: center;
  margin-bottom: 1rem;
  color: var(--color-text-muted);
}

.rt__title {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--color-text);
}

/* Hearts */
.rt__hearts {
  display: flex;
  gap: 0.75rem;
  margin-top: 2.5rem;
}

.rt__heart {
  appearance: none;
  background: none;
  border: 0;
  padding: 4px;
  cursor: none;
  color: rgba(255, 255, 255, 0.14);
  transition: color 0.25s var(--ease), transform 0.35s var(--ease);
}

.rt__heart svg {
  display: block;
  width: 52px;
  height: auto;
  animation: rtHeartReveal 1.1s cubic-bezier(0.33, 1, 0.68, 1) both;
  animation-delay: calc(0.55s + var(--i, 0) * 0.09s);
}

/* Blur + wave rise reveal: hearts surface out of a soft blur one after
   another, rise from below, overshoot slightly and settle — a wave. */
@keyframes rtHeartReveal {
  0% {
    opacity: 0;
    filter: blur(12px);
    transform: translateY(28px) scale(0.8);
  }
  55% {
    opacity: 1;
    filter: blur(1px);
    transform: translateY(-6px) scale(1.04);
  }
  80% {
    filter: blur(0);
    transform: translateY(2px) scale(0.99);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: none;
  }
}

.rt__heart.is-on { color: var(--color-accent); }
.rt__heart.is-preview { color: rgba(255, 75, 56, 0.55); }
.rt__heart:hover { transform: translateY(-3px); }
.rt__heart.is-pop { animation: rtPop 0.4s var(--ease); }

.rt__heart:focus-visible {
  outline: none;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.35));
}

@keyframes rtPop {
  40% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

.rt__hint {
  margin-top: 0.75rem;
  min-height: 1.5em;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  transition: color 0.3s var(--ease);
}

.rt__hint.is-set { color: var(--color-text); }

/* Chips */
.rt__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  width: 100%;
  margin-top: 3rem;
  text-align: left;
}

.rt__group {
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
}

.rt__legend {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  margin-bottom: 0.75rem;
}

.rt__chip { position: relative; cursor: none; }

.rt__chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rt__chip span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.rt__chip span::before {
  content: '+';
  font-size: 0.875rem;
  line-height: 1;
  opacity: 0.6;
  transition: transform 0.3s var(--ease);
}

.rt__chip:hover span {
  color: var(--color-text);
  border-color: rgba(255, 255, 255, 0.2);
}

.rt__chip input:checked + span {
  color: #000;
  background: #fff;
  border-color: #fff;
}

.rt__chip input:checked + span::before {
  transform: rotate(45deg);
  opacity: 1;
}

.rt__group--neg .rt__chip input:checked + span {
  color: #fff;
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.rt__chip input:focus-visible + span {
  outline: 1px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Role */
.rt__role {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  max-width: 320px;
  margin-top: 3rem;
  padding: 0 1.25rem;
  height: 52px;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  font-size: 0.9375rem;
  transition: border-color 0.25s var(--ease);
}

.rt__role:hover,
.rt__role:focus-within { border-color: rgba(255, 255, 255, 0.25); }

.rt__role-prefix { color: var(--color-text); white-space: nowrap; }

.rt__role select {
  appearance: none;
  -webkit-appearance: none;
  flex: 1;
  min-width: 0;
  height: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  font: inherit;
  color: var(--color-text-muted);
  cursor: none;
  padding-right: 1.5rem;
}

.rt__role select.is-set { color: var(--color-text); }
.rt__role select option { color: #000; }

.rt__role-arrow {
  position: absolute;
  right: 1.25rem;
  color: var(--color-text-muted);
  pointer-events: none;
}

/* Comment */
.rt__comment {
  width: 100%;
  max-width: 320px;
  margin-top: 0.75rem;
  padding: 0.9rem 1.25rem;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--color-text);
  resize: vertical;
  outline: 0;
  transition: border-color 0.25s var(--ease);
}

.rt__comment::placeholder { color: var(--color-text-muted); }
.rt__comment:focus { border-color: rgba(255, 255, 255, 0.25); }

.rt__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* Send */
.rt__send {
  margin-top: 2rem;
  min-width: 160px;
  height: 52px;
  padding: 0 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #000;
  border: 1px solid #fff;
  border-radius: 100px;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: none;
  transition: opacity 0.25s var(--ease), transform 0.35s var(--ease), background 0.25s var(--ease);
}

.rt__send:hover:not(:disabled) { transform: translateY(-2px); }
.rt__send:disabled { opacity: 0.25; }

.rt__send--ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.rt__error {
  min-height: 1.5em;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--color-accent);
}

.rt__done-text {
  margin-top: 1.25rem;
  max-width: 36ch;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-dim);
}

@media (max-width: 768px) {
  .rt { padding-top: 7.5rem; }
  .rt__heart svg { width: 44px; }
  .rt__hearts { gap: 0.25rem; }
  .rt__heart, .rt__chip, .rt__role select, .rt__send { cursor: auto; }
}

@media (max-width: 520px) {
  .rt__cols { grid-template-columns: 1fr; gap: 2rem; }
  .rt__heart svg { width: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .rt__form, .rt__done, .rt__heart.is-pop, .rt__heart svg { animation: none; }
  .rt .hero__word-inner { animation: none; transform: none; }
}
