:root {
  --plum: #4a2545;
  --sand: #e8dcc8;
  --gold: #b08d57;
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Source Sans", "Source Sans 3", "Source Sans Pro", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--sand);
  color: var(--plum);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  margin: 0;
}

p {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.65rem 1rem;
  background: var(--plum);
  color: var(--sand);
  font-weight: 600;
  border-radius: 3px;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.page {
  display: grid;
  grid-template-columns: min(560px, 39vw) minmax(0, 1fr);
  min-height: 100vh;
}

/* Plum masthead */

.masthead {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 64px 64px 42px;
  background: var(--plum);
  color: var(--sand);
}

.masthead-inner {
  margin-block: auto;
  max-width: 420px;
}

.eyebrow {
  margin: 0 0 0.6rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  line-height: 1.4;
  text-transform: uppercase;
  opacity: 0.7;
}

.eyebrow--light {
  opacity: 0.75;
}

.panel-title {
  margin: 0 0 1.25rem;
  font-family: var(--serif);
  font-size: 3.125rem;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.panel-subtitle {
  margin: 0 0 2rem;
  font-size: 1.0625rem;
  line-height: 1.5;
  opacity: 0.85;
}

.panel-rule {
  width: 80px;
  height: 0;
  margin: 0 0 1.6rem;
  border: 0;
  border-top: 2px solid var(--gold);
}

.panel-tagline {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.3;
  opacity: 0.95;
}

.masthead-foot {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  opacity: 0.7;
}

/* Sand reading column: the welcome screen */

.content {
  min-width: 0;
}

.welcome {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 112px 100px 42px 80px;
}

.welcome-inner {
  width: 100%;
  max-width: 700px;
}

.welcome h1 {
  max-width: 620px;
  margin-bottom: 1.15rem;
  font-size: 2.5rem;
  line-height: 1.15;
}

.lede {
  max-width: 700px;
  margin-bottom: 2.4rem;
  font-size: 1rem;
  line-height: 1.5;
}

.callout {
  position: relative;
  max-width: 700px;
  margin: 0 0 2.25rem;
  padding: 20px 32px 20px 30px;
  border: 1px solid rgba(74, 37, 69, 0.4);
  border-left: 4px solid var(--gold);
  border-radius: 2px;
}

.callout-title {
  margin-bottom: 0.3rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
}

.callout p:last-child {
  max-width: 600px;
  font-size: 0.8125rem;
  line-height: 1.5;
  opacity: 0.85;
}

.scale-section {
  max-width: 700px;
  margin: 0 0 2.75rem;
}

.scale-label {
  margin: 0 0 0.4rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1.6;
  text-transform: uppercase;
  opacity: 0.6;
}

.scale-key {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
  line-height: 1.7;
}

.scale-key li {
  white-space: nowrap;
}

.key-num {
  font-weight: 600;
}

.hint {
  max-width: 700px;
  margin: 0.5rem 0 0.85rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  opacity: 0.7;
}

.begin {
  margin: 0;
}

.begin-button {
  display: inline-flex;
  width: 260px;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--plum);
  border-radius: 2px;
  background: var(--plum);
  color: var(--sand);
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  transition: box-shadow 150ms ease;
}

.begin-button:hover {
  box-shadow: inset 0 0 0 2px var(--gold);
}

.begin-helper {
  margin-top: 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  opacity: 0.7;
}

.welcome-foot {
  margin: auto 0 0;
  padding-top: 2.5rem;
  font-size: 0.75rem;
  line-height: 1.4;
  opacity: 0.6;
}

/* The survey itself */

.survey {
  padding: 0 100px 64px 80px;
}

.survey form,
.survey .thank-you {
  max-width: 700px;
}

#survey-form {
  scroll-margin-top: 2rem;
}

.form-section {
  margin-top: 3.25rem;
  padding-top: 2.25rem;
  border-top: 1px solid rgba(74, 37, 69, 0.22);
}

h2 {
  font-size: 1.9rem;
  margin-bottom: 0.85rem;
}

.group-field {
  min-width: 0;
  margin: 0 0 2.5rem;
  padding: 0;
  border: 0;
}

.group-field legend {
  margin-bottom: 0.5rem;
  padding: 0;
  font-weight: 600;
}

#rater-group {
  min-width: 16rem;
  max-width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(74, 37, 69, 0.45);
  border-radius: 3px;
  background: transparent;
  color: var(--plum);
  font: inherit;
}

.group-note {
  margin: 0 0 2.5rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--gold);
  background: rgba(74, 37, 69, 0.06);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.statement {
  min-width: 0;
  margin: 0 0 2.35rem;
  padding: 0;
  border: 0;
}

.statement:last-child {
  margin-bottom: 0;
}

.statement legend {
  max-width: 620px;
  margin-bottom: 0.8rem;
  padding: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}

.scale-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}

.scale-choice {
  position: relative;
  display: block;
  cursor: pointer;
}

.scale-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.scale-face {
  display: flex;
  min-height: 3.35rem;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.5rem 0.2rem;
  border: 1px solid rgba(74, 37, 69, 0.45);
  border-radius: 3px;
  font-size: 0.875rem;
  line-height: 1.2;
  text-align: center;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.scale-number {
  font-weight: 600;
}

.scale-choice:hover .scale-face {
  border-color: var(--plum);
}

.scale-input:checked + .scale-face {
  background: var(--plum);
  border-color: var(--plum);
  color: var(--sand);
}

.scale-input:focus-visible + .scale-face {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(74, 37, 69, 0.22);
}

/* Open questions */

.field {
  margin-bottom: 2rem;
}

.field:last-child {
  margin-bottom: 0;
}

.field-label {
  display: block;
  max-width: 620px;
  margin-bottom: 0.25rem;
  font-weight: 600;
  line-height: 1.45;
}

textarea {
  display: block;
  width: 100%;
  min-height: 8.5rem;
  padding: 0.85rem 1rem;
  resize: vertical;
  border: 1px solid rgba(74, 37, 69, 0.45);
  border-radius: 3px;
  background: transparent;
  color: var(--plum);
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
}

textarea:hover {
  border-color: var(--plum);
}

textarea:focus-visible {
  border-color: var(--plum);
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* Sending */

.submit-row {
  margin-top: 3rem;
}

.submit-button {
  display: inline-flex;
  width: 260px;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--plum);
  border-radius: 2px;
  background: var(--plum);
  color: var(--sand);
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: box-shadow 150ms ease;
}

.submit-button:hover {
  box-shadow: inset 0 0 0 2px var(--gold);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.submit-row .hint {
  margin-top: 1rem;
}

.form-error {
  max-width: 700px;
  margin: 1.75rem 0 0;
  padding: 0.85rem 1rem;
  border-left: 4px solid var(--gold);
  background: rgba(74, 37, 69, 0.08);
  font-weight: 600;
}

.thank-you {
  margin-top: 2rem;
  padding: 2rem 2rem 2rem 2.25rem;
  border: 1px solid rgba(74, 37, 69, 0.45);
  border-left: 4px solid var(--gold);
  border-radius: 3px;
  scroll-margin-top: 2rem;
}

.thank-you:focus {
  outline: none;
}

.thank-you h2 {
  font-size: 2.1rem;
  margin-bottom: 0.9rem;
}

.content-foot {
  max-width: 700px;
  margin: 0 100px 64px 80px;
  padding-top: 1.15rem;
  border-top: 1px solid var(--gold);
  font-size: 0.75rem;
  line-height: 1.4;
  opacity: 0.6;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 1200px) {
  .welcome {
    padding-right: 64px;
    padding-left: 56px;
  }

  .survey,
  .content-foot {
    padding-right: 64px;
    padding-left: 56px;
  }

  .content-foot {
    margin-right: 0;
    margin-left: 0;
    max-width: none;
  }

  .survey form,
  .survey .thank-you {
    max-width: 700px;
  }
}

@media (max-width: 1060px) {
  .scale-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .scale-choice:last-child:nth-child(3n + 2) {
    grid-column: span 2;
  }
}

@media (max-width: 980px) {
  .page {
    display: block;
  }

  .masthead {
    position: static;
    height: auto;
    min-height: 0;
    padding: 2.75rem 1.5rem 2.25rem;
  }

  .masthead-inner {
    margin: 0;
    max-width: 34rem;
  }

  .panel-title {
    font-size: 2.6rem;
    margin-bottom: 1rem;
  }

  .panel-subtitle {
    margin-bottom: 1.5rem;
  }

  .panel-rule {
    margin-bottom: 1.5rem;
  }

  .masthead-foot {
    margin-top: 2.25rem;
  }

  .welcome {
    min-height: 0;
    padding: 2.75rem 1.5rem 2.5rem;
  }

  .welcome h1 {
    font-size: 2.3rem;
  }

  .welcome-foot {
    padding-top: 2rem;
  }

  .survey {
    padding: 0 1.5rem 2.5rem;
  }

  .content-foot {
    margin: 0 1.5rem 2.5rem;
    max-width: none;
  }
}

@media (max-width: 620px) {
  .welcome h1 {
    font-size: 2.05rem;
  }

  h2 {
    font-size: 1.65rem;
  }

  .scale-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scale-choice:last-child:nth-child(3n + 2) {
    grid-column: auto;
  }

  .scale-choice:last-child:nth-child(odd) {
    grid-column: span 2;
  }

  .begin-button,
  .submit-button {
    width: 100%;
  }

  .callout {
    padding: 1.1rem 1.15rem 1.1rem 1.3rem;
  }

  .scale-key {
    gap: 0.2rem 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
