/* The procrastination test (/test), on top of thanks.css (type, colours, the arrival and his window):
   one question at a time with big tap targets, then the profile and the report form. */
/* The footer (Home, Privacy) sits at the bottom of the screen, however short the page is. */
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
#main { flex: 1 0 auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.arrive h1 { font-size: clamp(2.2rem, 6.4vw, 4.2rem); max-width: 14em; }
.arrive[hidden], .quiz-steps[hidden] { display: none; }
.arrive .start { margin-top: 26px; height: 3.4rem; padding: 0 2.2rem; font-size: 1.125rem; border-radius: 10px;
  box-shadow: 0 10px 24px -10px rgba(47, 111, 134, .7); animation: rise .9s cubic-bezier(.16, 1, .3, 1) 1s both; }
/* The test itself: a wider window with bigger type, right under the top bar. */
.quiz-steps { max-width: 760px; padding-top: 4px; gap: 14px; }
.quiz-steps .q-text { font-size: clamp(1.45rem, 3.4vw, 2rem); }
.quiz-steps .q-options button { padding: 15px 18px; font-size: 1.0625rem; }
.quiz-steps > .sources { margin-top: 0; animation-delay: .7s; }
/* Start opens his window: it grows out of the page like a window opening, then he lands on it. */
.quiz-steps .w-inbox { transform-origin: 50% 20%; animation: winopen .6s cubic-bezier(.2, .9, .3, 1.1) .1s both; }
@keyframes winopen { from { opacity: 0; transform: translateY(28px) scale(.86); } 55% { opacity: 1; } to { opacity: 1; transform: none; } }
/* The window keeps one place on the screen from question to question (a little below the top bar). On a computer
   it is big and roomy: it grows with the screen, the question and its answers sit in the middle of it with wide
   margins, and the answers are large tiles with room between them. */
@media (min-width: 900px) {
  .quiz-steps { max-width: 1000px; padding-top: clamp(4px, 5vh, 56px); }
  .quiz-steps .quiz, .quiz-steps .think { display: flex; flex-direction: column; justify-content: center;
    min-height: max(0px, calc(100vh - 400px)); min-height: max(0px, calc(100svh - 400px)); padding: 44px 0 52px; }
  .quiz-steps .q-count { margin: 0 56px; }
  .quiz-steps .q-text { margin: 12px 56px 34px; font-size: 2.5rem; }
  .quiz-steps .q-options { padding: 0 56px; gap: 14px; }
  .quiz-steps .q-options button { padding: 26px 18px; font-size: 1.125rem; }
  /* Every question's answers sit in one row of equal tiles, the words centred. */
  .quiz-steps .q-options, .quiz-steps .q-options.is-scale { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .quiz-steps .q-options button { display: flex; align-items: center; justify-content: center; text-align: center; }
  .quiz-steps .q-options:not(.is-scale) button { padding: 20px 16px; font-size: 1.0625rem; }
  .quiz-steps .q-back { position: static; align-self: flex-start; margin: 24px 56px 0; }
  .quiz-steps .q-next { align-self: flex-start; margin: 24px 56px 0; }
  .quiz-steps .q-back[hidden] { display: block; visibility: hidden; }
  .quiz-steps .think { padding: 30px 0 30px; }
  .quiz-steps .think .q-text { margin-bottom: 18px; font-size: 2.1rem; }
  .quiz-steps .think-body { grid-template-columns: 320px minmax(0, 1fr); margin: 0 56px; gap: 56px; }
  .quiz-steps .think-steps { gap: 18px; font-size: 1.0625rem; }
  /* The result: the profile on the left, the report form on the right, so it all shows on one screen. */
  .quiz-steps .result { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); grid-template-rows: auto auto auto 1fr;
    column-gap: 56px; padding: 36px 56px 40px; }
  .quiz-steps .r-kicker { grid-row: 1; grid-column: 1; }
  .quiz-steps .result h2 { grid-row: 2; grid-column: 1; }
  .quiz-steps .r-tag { grid-row: 3; grid-column: 1; }
  .quiz-steps .r-form, .quiz-steps .r-sent { grid-row: 1 / span 4; grid-column: 2; margin-top: 0; padding: 0 0 0 40px; border-top: 0;
    border-left: 1px solid rgba(20, 32, 43, .09); }
  .quiz-steps .perch-say { font-size: 1.0625rem; }
}
.lead b { font-weight: 600; }
/* The research the report rests on, named under the promise. */
.sources { margin-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 3px; font: 500 12px var(--font-m);
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted); animation: rise .9s cubic-bezier(.16, 1, .3, 1) 1s both; }
.sources span { display: flex; flex-wrap: wrap; justify-content: center; font: 400 .875rem var(--font-b); letter-spacing: 0;
  text-transform: none; color: var(--ink-2); padding: 0 12px; text-align: center; }
.sources i { font-style: normal; white-space: nowrap; }
.sources i + i::before { content: "\00b7"; margin: 0 .45em; color: var(--muted); }
/* On a phone the studies take two centred lines: the first two together, the third under them. */
@media (max-width: 560px) {
  .sources span { display: block; }
  .sources i:last-child { display: block; }
  .sources i:last-child::before { content: none; }
}
/* On a phone the test fits a short screen (browser bars included): a smaller Guardian close to the top bar,
   and the research right under his window. */
@media (max-width: 560px) {
  .quiz-steps { padding-top: 0; gap: 10px; }
  .quiz-steps .perch { padding-top: 72px; }
  .quiz-steps .perch-g { right: 14px; top: 2px; width: 80px; }
  .quiz-steps .land, .quiz-steps .g-arrive { width: 80px; }
  .quiz-steps .land { height: 71px; }
  .quiz-steps .perch-say { right: 102px; top: 8px; max-width: calc(100% - 108px); }
  .quiz-steps .q-count { margin-top: 14px; }
  .quiz-steps .q-text { margin-bottom: 12px; }
  .quiz-steps .quiz { padding-bottom: 16px; }
}

.quiz { position: relative; padding: 4px 0 20px; }
/* The result scrolls into view with Guardian's line above it, clear of the sticky top bar. */
.quiz-steps .perch { scroll-margin-top: 64px; }
.quiz[hidden], .result[hidden], .quiz-wait[hidden], .r-form[hidden], .r-sent[hidden], .q-back[hidden], .r-small[hidden] { display: none; }
.quiz-wait { padding: 22px 20px; color: var(--muted); }
/* How far along: a thin petrol line under the window bar. */
.q-bar { position: absolute; top: 0; left: 0; right: 0; height: 4px; background: rgba(20, 32, 43, .07); }
.q-bar i { display: block; height: 100%; width: 0; background: var(--petrol); border-radius: 0 4px 4px 0; transition: width .35s cubic-bezier(.3, .7, .2, 1); }
.q-count { margin: 16px 20px 0; font: 500 12px var(--font-m); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.q-text { margin: 8px 20px 16px; font-size: clamp(1.35rem, 3.6vw, 1.7rem); line-height: 1.2; outline: none; }
.q-options { display: grid; gap: 10px; padding: 0 20px; }
/* Each answer is a tile with one soft flat fill, so it reads as a choice to tap. */
.q-options button { display: block; width: 100%; padding: 14px 16px; border-radius: 10px; border: 1px solid transparent; background: rgba(20, 32, 43, .055);
  color: var(--ink); font: 500 1rem/1.35 var(--font-b); text-align: left; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.q-options button:hover { background: rgba(20, 32, 43, .085); border-color: rgba(47, 111, 134, .5); }
.q-options button:active { transform: scale(.99); }
.q-options button:focus-visible { outline: 2px solid var(--petrol); outline-offset: 2px; }
.q-options button.is-picked { background: rgba(47, 111, 134, .1); border-color: var(--petrol); color: var(--petrol-d); box-shadow: inset 0 0 0 1px var(--petrol); font-weight: 600; }
/* The scale reads left to right on wide screens, as a list on phones. */
@media (min-width: 640px) {
  .q-options.is-scale { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .q-options.is-scale button { text-align: center; padding: 18px 6px; }
}
.q-in { animation: qin .32s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes qin { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
/* Back sits on the question's count line, at the right, so it costs the window no height. */
.q-back { position: absolute; top: 15px; right: 20px; margin: 0; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: .9375rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.q-back:hover { color: var(--ink); }
.q-next { margin: 16px 20px 0; padding: 0 1.8rem; }
.q-next[hidden] { display: none; }
.q-next:disabled { opacity: .45; cursor: default; }

/* Working it out: a chart of the five drivers grows to the real scores beside four steps that tick off one by one;
   the strongest two stand out, then the strongest one lights up. */
.think[hidden] { display: none; }
.think { padding: 0 0 24px; }
.think-body { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 28px; align-items: center; margin: 4px 20px 0; }
.radar { display: block; width: 100%; height: auto; overflow: visible; }
.radar .web { fill: none; stroke: rgba(20, 32, 43, .1); stroke-width: 1; }
.radar .axis { stroke: rgba(20, 32, 43, .08); stroke-width: 1; }
.radar .shape { fill: rgba(47, 111, 134, .14); stroke: var(--petrol); stroke-width: 2; stroke-linejoin: round; }
.radar .pt { fill: #fff; stroke: var(--petrol); stroke-width: 2; transition: fill .3s; }
.radar .pt.is-strong, .radar .pt.is-top { fill: var(--petrol); }
.radar text { font: 500 15px var(--font-b); fill: var(--muted); transition: fill .3s; }
.radar text.is-strong { fill: var(--ink); font-weight: 600; }
.radar text.is-top { fill: var(--petrol-d); font-weight: 700; }
.think.is-done .radar .pt:not(.is-top) { fill: #fff; }
.think.is-done .radar text:not(.is-top) { fill: var(--muted); font-weight: 500; }
.think-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.think-steps li { position: relative; padding-left: 32px; color: var(--muted); transition: color .3s; }
.think-steps li::before { content: ""; position: absolute; left: 0; top: .15em; width: 20px; height: 20px; border-radius: 50%; box-sizing: border-box;
  border: 1.5px solid rgba(20, 32, 43, .2); }
.think-steps li.is-on { color: var(--ink); font-weight: 600; }
.think-steps li.is-on::before { border: 2px solid var(--petrol); border-top-color: transparent; animation: spin .8s linear infinite; }
.think-steps li.is-done { color: var(--ink-2); }
.think-steps li.is-done::before { border: 0; background: center / 11px 11px no-repeat url("../assets/step-tick.svg"), var(--petrol); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 700px) {
  .think-body { grid-template-columns: 1fr; gap: 14px; }
  .radar { max-width: 340px; justify-self: center; }
  .think-steps { gap: 9px; font-size: .9375rem; }
}
@media (max-width: 560px) { .think-body { margin: 0 16px; } }

/* The profile. */
.result { padding: 22px 20px 22px; animation: rise .6s cubic-bezier(.16, 1, .3, 1) both; }
.r-kicker, .r-k { margin: 0; font: 500 12px var(--font-m); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.result h2 { margin-top: 6px; font-size: clamp(2rem, 6vw, 2.8rem); color: var(--petrol); outline: none; }
.r-tag { margin-top: 6px; font: 700 1.2rem/1.3 var(--font-d); color: var(--ink); }
.r-about { margin-top: 14px; color: var(--ink-2); }
.r-tip { margin-top: 18px; padding: 14px 16px; border-radius: 10px; background: #fff; border: 1px solid var(--edge); box-shadow: inset 3px 0 0 var(--petrol); }
.r-tip p:last-child { margin-top: 6px; color: var(--ink-2); }
.r-tip b { color: var(--ink); }
.r-second { margin-top: 14px; color: var(--ink-2); }
.r-second b { color: var(--ink); }
.r-small { color: var(--muted); font-size: .875rem; }
.r-small a { color: var(--muted); }

.r-form { margin-top: 22px; padding-top: 20px; border-top: 1px solid rgba(20, 32, 43, .09); }
.r-form h3, .r-sent h3 { margin: 0; font: 760 1.35rem/1.15 var(--font-d); letter-spacing: -.018em; }
.r-form > p { margin-top: 10px; color: var(--ink-2); }
/* What the email holds: four ticked lines. */
.r-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.r-list li { position: relative; padding-left: 1.9rem; color: var(--ink); font-weight: 500; }
.r-list li::before { content: ""; position: absolute; left: 0; top: .12rem; width: 1.25rem; height: 1.25rem; border-radius: 50%;
  background: center / 11px 11px no-repeat url("../assets/step-tick.svg"), var(--petrol); }
.r-row { position: relative; display: flex; gap: 10px; margin: 14px 0 8px; }
.r-row input[type=email] { flex: 1; min-width: 0; height: 3rem; padding: 0 12px; border-radius: 8px; border: 1px solid rgba(20, 32, 43, .22); background: #fff; color: var(--ink); font: inherit; }
.r-row input[type=email]:focus { outline: 2px solid var(--petrol); outline-offset: 1px; border-color: transparent; }
.r-form .form-error { margin: 6px 0 0; }
@media (max-width: 360px) { .r-row { flex-direction: column; } .r-row input[type=email] { flex: none; } .r-row .button { width: 100%; } }
.r-sent { display: flex; gap: 16px; align-items: center; margin-top: 22px; padding-top: 20px; border-top: 1px solid rgba(20, 32, 43, .09); animation: rise .5s cubic-bezier(.16, 1, .3, 1) both; }
.r-sent p { margin-top: 4px; color: var(--ink-2); }

@media (max-width: 560px) {
  .q-count, .q-text { margin-left: 16px; margin-right: 16px; }
  .q-options { padding: 0 16px; gap: 7px; }
  .q-options button, .quiz-steps .q-options button { padding: 11px 16px; font-size: 1rem; }
  .q-back { top: 13px; right: 16px; }
  .q-next { display: flex; width: calc(100% - 32px); margin: 14px 16px 0; }
  .result { position: relative; padding: 18px 16px 18px; }
  .r-form { margin-top: 16px; padding-top: 14px; }
  .r-list { gap: 6px 10px; font-size: .9375rem; }
  .r-row .button { padding: 0 1rem; }
  .think .q-text { font-size: 1.35rem; margin-bottom: 10px; }
  .radar { max-width: 280px; }
}
@media (prefers-reduced-motion: reduce) {
  .q-in, .result, .r-sent, .think-steps li.is-on::before, .quiz-steps .w-inbox { animation: none; }
  .q-bar i { transition: none; }
}
