/* LOVR brand template. Single page. Renders questionnaire or report from data.json. */

:root {
  --bordeaux: #3a1212;
  --bordeaux-dark: #281010;
  --ecru: #f2e8dd;
  --ecru-light: #f9f5f1;
  --coco: #503831;
  --cherry: #b50a0a;

  --serif: 'Fraunces', 'Times New Roman', serif;
  --mono: 'DM Mono', ui-monospace, monospace;

  --canvas-max: 720px;
  --gutter: clamp(1.25rem, 5vw, 3rem);

  --rule: 1px solid color-mix(in srgb, var(--bordeaux) 18%, transparent);
  --rule-strong: 1px solid color-mix(in srgb, var(--bordeaux) 32%, transparent);
  --rule-light: 1px solid color-mix(in srgb, var(--ecru) 40%, transparent);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--ecru);
  color: var(--bordeaux);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.lovr-locked { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; }

/* ============================================================ */
/* PRE-SCROLLER                                                 */
/* ============================================================ */

.prescroller {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bordeaux);
  color: var(--ecru);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 600ms ease;
}

.prescroller.is-hidden { opacity: 0; pointer-events: none; }
.prescroller.is-gone { display: none; }

.prescroller__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3.4rem;
  width: min(420px, 80vw);
}

.prescroller__logo {
  width: clamp(140px, 22vw, 200px);
  height: auto;
  filter: brightness(0) invert(1);
  opacity: 0.94;
  user-select: none;
  pointer-events: none;
}

.prescroller__form { width: 100%; }

.prescroller__input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ecru) 40%, transparent);
  color: var(--ecru);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 0.7rem 0;
  outline: none;
  caret-color: var(--ecru);
  transition: border-color 220ms ease;
}

.prescroller__input:focus { border-bottom-color: var(--ecru); }
.prescroller__input::selection { background: color-mix(in srgb, var(--ecru) 25%, transparent); }

.prescroller__input.shake {
  animation: prescroller-shake 360ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes prescroller-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}

/* ============================================================ */
/* PAGE                                                         */
/* ============================================================ */

.page {
  opacity: 0;
  transition: opacity 700ms ease 60ms;
}

.page.is-revealed { opacity: 1; }

/* ============================================================ */
/* COVER                                                        */
/* ============================================================ */

.cover {
  width: 100%;
  padding: clamp(5rem, 14vh, 9rem) var(--gutter) clamp(3.5rem, 9vh, 6rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.1rem;
}

.cover__logo {
  width: clamp(140px, 18vw, 200px);
  height: auto;
  margin-bottom: 2rem;
}

.cover__title,
.cover__sub {
  font-family: var(--mono);
  font-weight: 400;
  text-transform: uppercase;
}

.cover__title {
  font-size: 0.82rem;
  letter-spacing: 0.34em;
}

.cover__sub {
  font-size: 0.7rem;
  letter-spacing: 0.26em;
  opacity: 0.68;
}

body[data-cover-variant="bordeaux"] .cover {
  background: var(--bordeaux);
  color: var(--ecru);
}
body[data-cover-variant="bordeaux"] .cover__logo {
  filter: brightness(0) invert(1);
  opacity: 0.96;
}
body[data-cover-variant="bordeaux"] .cover__title,
body[data-cover-variant="bordeaux"] .cover__sub { color: var(--ecru); }

body[data-cover-variant="ecru"] .cover {
  background: var(--ecru);
  color: var(--bordeaux);
}

/* ============================================================ */
/* CANVAS                                                       */
/* ============================================================ */

.canvas {
  max-width: var(--canvas-max);
  margin: 0 auto;
  padding: clamp(3rem, 8vh, 5rem) var(--gutter) 4rem;
}

/* ============================================================ */
/* BLOCKS                                                       */
/* ============================================================ */

.blocks { display: flex; flex-direction: column; }

.block {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 800ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 800ms cubic-bezier(0.22, 1, 0.36, 1);
}

.block.is-visible { opacity: 1; transform: translateY(0); }

.block + .block { margin-top: 2.4rem; }
.block + .block--headline,
.block--headline + .block { margin-top: 3.4rem; }
.block + .block--divider,
.block--divider + .block { margin-top: 4rem; }

/* eyebrow */
.block--eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--bordeaux);
  opacity: 0.78;
}

/* headline */
.block--headline {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.012em;
  max-width: 22ch;
  color: var(--bordeaux);
}

/* body */
.block--body {
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--bordeaux);
}

.block--body + .block--body { margin-top: 1.1rem; }

/* quote */
.block--quote {
  border-left: 1px solid color-mix(in srgb, var(--bordeaux) 30%, transparent);
  padding: 0.4rem 0 0.4rem 1.6rem;
  margin-left: 0.4rem;
  max-width: 36rem;
}

.block--quote .quote__text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.18rem;
  line-height: 1.55;
  color: var(--bordeaux);
}

.block--quote .quote__attr {
  margin-top: 0.95rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--bordeaux);
  opacity: 0.72;
}

/* divider */
.block--divider {
  height: 1px;
  width: 100%;
  background: color-mix(in srgb, var(--bordeaux) 20%, transparent);
  margin-top: 4rem;
  margin-bottom: 1.6rem;
}

/* question-with-notes */
.block--question-with-notes .q-text {
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--bordeaux);
  max-width: 38rem;
}

.block--question-with-notes .q-lines {
  margin-top: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.block--question-with-notes .q-line {
  height: 1px;
  width: 100%;
  background: color-mix(in srgb, var(--bordeaux) 22%, transparent);
}

body[data-type="questionnaire"] .block--question-with-notes .q-line {
  background: color-mix(in srgb, var(--bordeaux) 34%, transparent);
}

body[data-type="report"] .block--question-with-notes .q-lines { display: none; }

/* data-card */
.block--data-card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.3rem 1.5rem;
  border: 1px solid color-mix(in srgb, var(--bordeaux) 22%, transparent);
  border-radius: 2px;
  background: transparent;
}

.block--data-card .dc-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--bordeaux);
  opacity: 0.78;
}

.block--data-card .dc-value {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--bordeaux);
}

body[data-type="report"] .block--data-card {
  border-color: color-mix(in srgb, var(--bordeaux) 60%, transparent);
  background: color-mix(in srgb, var(--bordeaux) 5%, transparent);
}

/* image */
.block--image .img-frame {
  width: 100%;
  display: block;
  background: color-mix(in srgb, var(--bordeaux) 6%, transparent);
}

.block--image .img-caption {
  margin-top: 0.75rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bordeaux);
  opacity: 0.62;
}

/* ============================================================ */
/* FOOTER                                                       */
/* ============================================================ */

.page-footer { margin-top: 6rem; }

.page-footer__rule {
  height: 1px;
  background: color-mix(in srgb, var(--bordeaux) 18%, transparent);
  margin-bottom: 1.2rem;
}

.page-footer__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--bordeaux);
  opacity: 0.78;
}

/* ============================================================ */
/* RESPONSIVE                                                   */
/* ============================================================ */

@media (max-width: 600px) {
  html, body { font-size: 16px; }
  .canvas { padding: 2.6rem 1.1rem 3.4rem; }
  .block + .block { margin-top: 2rem; }
  .block--data-card { flex-direction: column; align-items: flex-start; gap: 0.4rem; padding: 1.1rem 1.2rem; }
  .cover { padding-left: 1.1rem; padding-right: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .block { transition: none; opacity: 1; transform: none; }
  .page { transition: none; }
  .prescroller { transition: none; }
}

@media print {
  body.lovr-locked { overflow: visible; }
  .prescroller { display: none !important; }
  .page { opacity: 1 !important; }
  .block { opacity: 1 !important; transform: none !important; }
  .cover { background: transparent !important; color: var(--bordeaux) !important; }
  .cover__logo { filter: none !important; }
}
