/* ==============
   Base / Reset
   ============== */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Merriweather", "Georgia", "Times New Roman", serif;
  line-height: 1.2;
}

/* Headings / UI text (sans) */
h1,
h2,
h3,
.nav-link,
.site-title,
label,
legend,
button {
  font-family: "Roboto", "Aptos", "Helvetica Neue", Arial, sans-serif;
}

/* Background around the paper */
.app-bg {
  min-height: 100%;
  padding: 24px;
  display: grid;
  place-items: center;
}

/* =========================
   Paper container (the page)
   ========================= */
.paper {
  width: min(1100px, 100%);
  max-width: 1100px;
  height: clamp(485px, 85vh, 720px);
  border-radius: 0;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #ffffff;
}

@media (max-width: 800px) {
  .app-bg {
    padding: 12px;
    align-items: start;
    justify-content: center;
  }
}

/* =================
   Header / Nav bar
   ================= */
.paper-header {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-left {
  display: flex;
  align-items: center;
}

.site-title {
  font-weight: 500;
  font-size: 15px;
  text-transform: uppercase;
  opacity: 0.8;
  letter-spacing: 0.06em;
  font-family: "Roboto Mono", "Consolas", monospace;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link {
  text-decoration: none;
  color: inherit;
  font-weight: 600;
  opacity: 0.75;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.nav-link--active {
  opacity: 1;
  text-decoration: underline;
}

button.dev-reset {
  border: 0;
  padding: 0;
  background: transparent;
  font-weight: 600;
  cursor: pointer;
}

/* =================
   Footer / Begin tab
   ================= */
.paper-footer {
  padding: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.footer-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0;
  padding-left: 18px;
  padding-right: 0;
  min-height: 44px;
}

.footer-text {
  opacity: 0.75;
  font-size: 14px;
  font-family: "Roboto Mono", "Consolas", monospace;
  display: flex;
  align-items: center;
  text-transform: uppercase;
  padding-right: 16px;
  letter-spacing: 0.06em;
}

.footer-cta {
  border-radius: 0;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 1px solid rgba(0, 0, 0, 0.18);
  padding: 0 86px;
  font-weight: 800;
  cursor: pointer;
  background: transparent;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
}

.footer-cta:hover {
  background: rgba(0, 0, 0, 0.03);
}

/* =================
   Main content area
   ================= */
.paper-main {
  padding: 45px 24px 24px 40px;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
}

.paper-main--poems {
  padding: 0;
}

@media (max-width: 800px) {
  .paper-main:not(.paper-main--poems) {
    padding: 24px 20px;
  }

  .paper-main.paper-main--poems {
    padding: 24px 20px;
  }
}

/* =========================
   Content wrappers
   ========================= */
.content-wrap {
  width: 96%;
  max-width: 100%;
  margin: 0;
}

.landing-wrap {
  width: 98%;
  max-width: 100%;
  margin: 0;
}

.survey-wrap {
  width: 96%;
  max-width: 100%;
  margin: 0;
  display: grid;
  gap: 12px;
}

/* Landing hero lines */
.landing-line {
  font-family: "Roboto", "Aptos", "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  font-size: clamp(3.3rem, 8vw, 4.8rem);
  line-height: 1.1;
  margin: 0 0 2px 0;
}

.landing-line--accent-1 {
  color: #111111;
}

.landing-line--accent-2 {
  color: #23a280;
}

.landing-line--accent-3 {
  color: #8eabe9;
}

.landing-line:last-child {
  margin-bottom: 0;
}

.landing-cursor {
  display: inline-block;
  animation: landing-cursor-blink 1s steps(2, start) infinite;
}

@keyframes landing-cursor-blink {
  0%,
  50% {
    opacity: 1;
  }
  50.01%,
  100% {
    opacity: 0;
  }
}

/* Standard body text size (non-landing) */
.content-wrap p,
.survey-wrap p,
.results-panel p {
  font-size: 1.2rem;
}

.content-wrap > p:first-child {
  margin-top: 0;
}

.results-panel > *:first-child {
  margin-top: 0;
}

.survey-wrap fieldset:first-child {
  padding-top: 0;
}

/* Section heading / title */
.section-heading {
  font-family: "Roboto", "Aptos", "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 1.2rem;
  margin: 0 0 6px 0;
}

/* Generic section divider line */
.section-divider {
  border: 0;
  border-top: 1px dashed rgba(0, 0, 0, 0.35);
  margin: 24px 0 20px 0;
}

.section-divider--results-mobile {
  display: none;
}

/* ==================
   Voting layout
   ================== */
.vote-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 0;
  height: 100%;
  min-height: 0;
}

@media (min-width: 801px) {
  .vote-grid::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    border-left: 1px dashed rgba(0, 0, 0, 0.35);
    transform: translateX(-0.5px);
    pointer-events: none;
  }
}

@media (max-width: 800px) {
  .vote-grid {
    grid-template-columns: 1fr;
    row-gap: 14px;
  }

  .vote-grid::before {
    content: none;
  }
}

/* ==================
   Poem "page" styling
   ================== */
.poem-panel {
  position: relative;
  border: none;
  border-radius: 0;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 0;
  cursor: pointer;
  user-select: none;
  background: transparent;
  justify-content: center;
  align-items: center;
  text-align: center;
}

@media (max-width: 800px) {
  .poem-panel {
    padding: 16px 0;
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
  }

  .vote-grid .poem-panel + .poem-panel {
    border-top: 1px dashed rgba(0, 0, 0, 0.35);
    padding-top: 40px;
  }
}

.poem-panel:focus-visible {
  outline: 3px solid rgba(0, 0, 0, 0.35);
  outline-offset: 2px;
}

.poem-text {
  margin: 20px auto 0 auto;
  white-space: pre-line;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 400;
  font-family: "Merriweather", "Georgia", "Times New Roman", serif;
  max-width: 40rem;
  text-align: left;
}

@media (max-width: 800px) {
  .poem-panel .poem-text {
    margin: 16px 0 0 0;
  }
}

.poem-panel.is-selected {
  background: rgba(0, 0, 0, 0.04);
}

.poem-panel.is-dimmed {
  opacity: 0.55;
}

/* ==========
   Survey / Reflection UI
   ========== */
fieldset {
  border: none;
  border-radius: 0;
  padding: 20px 0;
  margin: 0;
}

legend {
  font-weight: 600;
  padding: 0;
}

.survey-wrap legend {
  font-family: "Roboto", "Aptos", "Helvetica Neue", Arial, sans-serif;
  font-size: 3rem;
  line-height: 1.25;
  margin-bottom: 20px;
}

.survey-wrap .choice {
  font-family: "Merriweather", "Georgia", "Times New Roman", serif;
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.3;
}

.survey-wrap .field label {
  font-family: "Roboto", "Aptos", "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
}

.field {
  display: grid;
  gap: 6px;
}

.field .choice {
  font-family: "Roboto Mono", "Consolas", monospace;
  font-size: 0.75rem;
  opacity: 0.6;
}

label {
  font-weight: 400;
}

.field > label {
  font-family: "Roboto Mono", "Consolas", monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.95rem;
  font-weight: 600;
}

input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 0;
  border: 1px solid rgba(0, 0, 0, 0.18);
  font-size: 14px;
  text-transform: uppercase;
  background: transparent;
  font-family: "Roboto Mono", "Consolas", monospace;
}

input[type="email"]::placeholder {
  font-family: "Roboto Mono", "Consolas", monospace;
  text-transform: uppercase;
  font-size: 0.8em;
  opacity: 0.8;
}

.choice {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
}

.survey-wrap .choice:last-child {
  padding-bottom: 0;
}

.button-row {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 10px;
}

/* =========================
   Button system
   ========================= */
button {
  border: none;
  padding: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  font-family: "Roboto", "Aptos", "Helvetica Neue", Arial, sans-serif;
}

.btn {
  border: 1px solid rgba(0, 0, 0, 0.18);
  padding: 10px 14px;
  border-radius: 0;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 14px;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Notices / alerts (loading, errors, etc.) */
.notice {
  font-size: 14px;
  opacity: 0.75;
  font-family: "Roboto Mono", "Consolas", monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Newsletter thank-you notices are intentionally smaller */
.results-panel--newsletter .notice,
#aboutNewsletterForm .notice {
  font-size: 12px;
}

/* Inline error messages */
.field-error {
  display: inline;
  margin-left: 6px;
  font-family: "Roboto Mono", "Consolas", monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.9rem;
  font-weight: 600;
  color: #dc5a39;
}

/* ==========
   Results split layout
   ========== */
.results-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%;
  min-height: 0;
}

@media (min-width: 801px) {
  .results-grid::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    border-left: 1px dashed rgba(0, 0, 0, 0.35);
    transform: translateX(-0.5px);
    pointer-events: none;
  }
}

.results-panel {
  padding: 0 40px 40px 40px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  height: 100%;
  min-height: 0;
}

/* All results text (stats panel) in monospaced style */
.results-panel--stats {
  font-family: "Roboto Mono", "Consolas", monospace;
}

/* SESSION SUMMARY heading inside stats panel */
.results-panel--stats p:first-child {
  font-family: "Roboto", "Aptos", "Helvetica Neue", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 1rem;
  margin: 0 0 4px 0;
}

/* Tighten spacing between lines in results */
.results-panel p {
  margin: 2px 0;
}

/* Big percentage value */
.results-panel .results-stat-value {
  font-family: "Roboto Mono", "Consolas", monospace;
  font-weight: 700;
  font-size: 3.2rem;
  margin: 4px 0 4px 0;
}

/* Alignment explanation line */
.results-stat-caption {
  font-family: "Roboto Mono", "Consolas", monospace;
  font-weight: 400;
  font-size: 1.1rem;
  text-transform: none;
  letter-spacing: 0;
}

/* Mobile: stack results panels */
@media (max-width: 800px) {
  .results-grid {
    grid-template-columns: 1fr;
    row-gap: 14px;
  }

  .results-panel {
    padding: 0 20px 24px 20px;
  }

  .results-grid::before {
    content: none;
  }

  .section-divider--results-mobile {
    display: block;
  }
}

/* ==========
   Mobile typography tweaks
   ========== */
@media (max-width: 600px) {
  .content-wrap p,
  .survey-wrap p,
  .results-panel p {
    font-size: 1.1rem;
  }

  .results-panel .results-stat-value {
    font-size: 2.2rem;
  }

  .survey-wrap legend {
    font-size: 1.7rem;
  }

  .survey-wrap .choice {
    font-size: 1rem;
  }
}

/* ==========
   Test-mode color accents
   ========== */
body.mode-poems .site-title {
  color: #2365f4;
}

body.mode-poems .footer-text,
body.mode-survey .footer-text {
  color: #2365f4;
}
