/* The Forge — application flow. Same palette and type as the page it opens from. */

:root {
  --ink: #0a0a0a;
  --cream: #f5f0e8;
  --orange: #e85d04;
  --orange-hot: #ff7a2f;
  --muted: rgba(245, 240, 232, 0.55);
  --line: rgba(245, 240, 232, 0.16);
  --cond: 'Barlow Condensed', 'Helvetica Neue', sans-serif;
  --serif: 'Lora', Georgia, serif;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

/* the captured page keeps its own inline styles; these only cover what we add */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
}
[data-reveal].is-in {
  opacity: 1;
  transform: translateY(0);
}
a[data-cta]:hover {
  background: var(--orange-hot) !important;
}
a[data-cta]:active {
  transform: scale(0.97) !important;
}

/* ---------------------------------------------------------------- overlay */

#forge-quiz {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  background: var(--ink);
  color: var(--cream);
  overflow: hidden;
}
#forge-quiz.is-open {
  display: block;
}
body.quiz-open {
  overflow: hidden;
}

.fq-embers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 45% at 50% 108%, rgba(232, 93, 4, 0.28) 0%, rgba(232, 93, 4, 0) 70%),
    radial-gradient(40% 30% at 12% -8%, rgba(232, 93, 4, 0.1) 0%, rgba(232, 93, 4, 0) 70%);
}
.fq-embers::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 80%, rgba(255, 150, 60, 0.55), transparent),
    radial-gradient(1.5px 1.5px at 70% 92%, rgba(255, 150, 60, 0.4), transparent),
    radial-gradient(1px 1px at 45% 70%, rgba(255, 180, 90, 0.4), transparent),
    radial-gradient(1px 1px at 85% 75%, rgba(255, 150, 60, 0.3), transparent);
  animation: fq-float 14s linear infinite;
  opacity: 0.9;
}
@keyframes fq-float {
  from { transform: translateY(0); opacity: 0.7; }
  50%  { opacity: 1; }
  to   { transform: translateY(-140px); opacity: 0; }
}

/* ------------------------------------------------------------------- chrome */

.fq-top {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.5rem 0.9rem;
}
.fq-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--cond);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.fq-brand img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}
.fq-count {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.fq-close {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  transition: color 0.2s;
}
.fq-close:hover { color: var(--cream); }

.fq-bar {
  position: relative;
  z-index: 3;
  height: 2px;
  background: rgba(245, 240, 232, 0.09);
  margin: 0 1.5rem;
}
.fq-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(to right, var(--orange), var(--orange-hot));
  transition: width 0.55s var(--ease);
}

/* --------------------------------------------------------------------- card */

.fq-stage {
  position: relative;
  z-index: 2;
  height: calc(100dvh - 66px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
}
.fq-card {
  /* margin:auto centres short cards and still lets tall ones scroll from the top */
  margin: auto;
  width: 100%;
  max-width: 720px;
  padding: 2.5rem 1.5rem 3.5rem;
}
.fq-card.is-out {
  animation: fq-out 0.24s var(--ease) forwards;
}
.fq-card.is-in > * {
  animation: fq-in 0.5s var(--ease) both;
}
.fq-card.is-in > *:nth-child(1) { animation-delay: 0.02s; }
.fq-card.is-in > *:nth-child(2) { animation-delay: 0.07s; }
.fq-card.is-in > *:nth-child(3) { animation-delay: 0.12s; }
.fq-card.is-in > *:nth-child(4) { animation-delay: 0.17s; }
.fq-card.is-in > *:nth-child(5) { animation-delay: 0.21s; }
@keyframes fq-in {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fq-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-22px); }
}

.fq-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--cond);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 1.4rem;
}
.fq-eyebrow i {
  display: block;
  width: 26px;
  height: 1px;
  background: var(--orange);
}

.fq-q {
  font-family: var(--cond);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 0.98;
  letter-spacing: 0.005em;
  color: var(--cream);
  font-size: clamp(1.9rem, 5.6vw, 3.1rem);
  margin: 0 0 0.9rem;
  text-wrap: balance;
}
.fq-q.is-long { font-size: clamp(1.5rem, 4.2vw, 2.35rem); }
.fq-help {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(245, 240, 232, 0.6);
  margin: 0 0 2.1rem;
  max-width: 46ch;
}
.fq-body { margin-bottom: 2rem; }

/* inputs */
.fq-field { margin-bottom: 1.6rem; }
.fq-label {
  display: block;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.45);
  margin-bottom: 0.5rem;
}
.fq-input,
.fq-textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--cream);
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.5;
  padding: 0.5rem 0 0.7rem;
  outline: none;
  border-radius: 0;
  transition: border-color 0.25s, background 0.25s;
  -webkit-appearance: none;
}
.fq-textarea {
  resize: none;
  min-height: 3.2rem;
  overflow: hidden;
}
.fq-input:focus,
.fq-textarea:focus { border-bottom-color: var(--orange); }
.fq-input::placeholder,
.fq-textarea::placeholder { color: rgba(245, 240, 232, 0.22); }
.fq-input.has-error,
.fq-textarea.has-error { border-bottom-color: #d33; }
.fq-grid {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: 1fr 1fr;
}
.fq-grid .fq-field { margin-bottom: 0; }
@media (max-width: 620px) {
  .fq-grid { grid-template-columns: 1fr; }
}

/* choices */
.fq-choices { display: flex; flex-direction: column; gap: 0.6rem; }
.fq-choice {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  text-align: left;
  background: rgba(245, 240, 232, 0.03);
  border: 1px solid var(--line);
  color: var(--cream);
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.4;
  padding: 0.95rem 1.1rem;
  cursor: pointer;
  border-radius: 2px;
  transition: border-color 0.18s, background 0.18s, transform 0.18s var(--ease);
}
.fq-choice:hover {
  border-color: rgba(232, 93, 4, 0.6);
  background: rgba(232, 93, 4, 0.07);
  transform: translateX(3px);
}
.fq-choice.is-on {
  border-color: var(--orange);
  background: rgba(232, 93, 4, 0.14);
}
.fq-key {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--cond);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  transition: all 0.18s;
}
.fq-choice.is-on .fq-key {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--ink);
}

/* scale */
.fq-scale {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.4rem;
}
.fq-dot {
  aspect-ratio: 1;
  min-height: 44px;
  background: rgba(245, 240, 232, 0.03);
  border: 1px solid var(--line);
  color: var(--cream);
  font-family: var(--cond);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.18s var(--ease);
}
.fq-dot:hover { border-color: var(--orange); transform: translateY(-3px); }
.fq-dot.is-on {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--ink);
  transform: translateY(-3px);
}
.fq-scale-labels {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.85rem;
  font-family: var(--cond);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.4);
}
@media (max-width: 620px) {
  .fq-scale { grid-template-columns: repeat(5, 1fr); }
}

/* actions */
.fq-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.fq-next {
  font-family: var(--cond);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--orange);
  border: 0;
  padding: 0.95rem 2.4rem;
  border-radius: 1px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.16s var(--ease);
}
.fq-next:hover { background: var(--orange-hot); }
.fq-next:active { transform: scale(0.97); }
.fq-next[disabled] { opacity: 0.35; cursor: not-allowed; }
.fq-hint {
  font-family: var(--cond);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.32);
}
.fq-back {
  background: none;
  border: 0;
  color: rgba(245, 240, 232, 0.42);
  font-family: var(--cond);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.5rem 0;
  transition: color 0.2s;
}
.fq-back:hover { color: var(--cream); }
.fq-error {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9rem;
  color: #ff8a6a;
  margin-top: 0.9rem;
  min-height: 1.2em;
}
@media (max-width: 620px) {
  .fq-hint { display: none; }
  .fq-next { width: 100%; text-align: center; }
}

/* intro + done */
.fq-lede {
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.75;
  color: rgba(245, 240, 232, 0.72);
  margin: 0 0 1.15rem;
  max-width: 54ch;
}
.fq-sig {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.45);
  margin: 1.6rem 0 2.2rem;
}
.fq-note {
  font-family: var(--cond);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.3);
  margin-top: 1.1rem;
}
.fq-flame {
  width: 54px;
  height: 54px;
  object-fit: contain;
  margin-bottom: 1.4rem;
}
