/* The RE+ 26 booth landing: "House lights".
   A dark stage with one line of light on the horizon. A field of solar trackers sits below it
   and follows the pointer like the sun. On submit the line opens onto the booth's house photo. */

:root {
  --ink: #16111f; /* artemispower.com near-black */
  --paper: #fffcf9; /* Offwhite */
  --purple: #6e04bd; /* Purple 500 */
  --purple-300: #9e57d3; /* Purple 300 */
  --purple-100: #d2b1eb; /* Purple 100 */
  --purple-50: #f1e6f8; /* Purple 50 */
  --horizon: 58%;
  --display: 'New Science', 'Plus Jakarta Sans', Arial, sans-serif;
  --body: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-step: cubic-bezier(0.2, 1, 0.2, 1);
}

@font-face {
  font-family: 'New Science';
  src: url('/fonts/new-science-medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'New Science';
  src: url('/fonts/new-science-semibold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  font-weight: 400 600;
  font-display: swap;
}

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

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

/* ---------- Stage ---------- */

.stage {
  --t: 0;
  container-type: inline-size;
  height: 100dvh;
  isolation: isolate;
  min-height: 560px;
  overflow: hidden;
  position: relative;
}

.field {
  display: block;
  height: 100%;
  inset: 0;
  position: absolute;
  transition: opacity 900ms;
  width: 100%;
}

.vignette {
  background: radial-gradient(120% 80% at 50% var(--horizon), rgb(22 17 31 / 0) 30%, rgb(22 17 31 / 0.75) 100%);
  inset: 0;
  pointer-events: none;
  position: absolute;
}

/* The booth's golden-hour house, hidden behind the line until the demo starts. */
.curtain {
  background: url('/re-plus-house.jpg') right center / cover no-repeat;
  clip-path: inset(var(--horizon) 0 calc(100% - var(--horizon)) 0);
  inset: 0;
  position: absolute;
  transition: clip-path 1500ms var(--ease-out) 500ms;
}

.curtain::after {
  background: linear-gradient(to top, rgb(22 17 31 / 0.88), rgb(22 17 31 / 0.15) 55%);
  content: '';
  inset: 0;
  position: absolute;
}

/* The line of light. It brightens as the visitor types (--t). */
.horizon {
  background: linear-gradient(90deg, rgb(158 87 211 / 0), var(--purple-300) 16%, var(--purple-50) 50%, var(--purple-300) 84%, rgb(158 87 211 / 0));
  box-shadow:
    0 0 calc(1cqw + var(--t) * 2cqw) calc(0.2cqw + var(--t) * 0.4cqw) rgb(158 87 211 / 0.6),
    0 0 calc(6cqw + var(--t) * 6cqw) calc(1cqw + var(--t) * 2cqw) rgb(110 4 189 / 0.22);
  height: max(1.5px, 0.12cqw);
  left: 0;
  opacity: calc(0.8 + var(--t) * 0.2);
  position: absolute;
  right: 0;
  top: var(--horizon);
  transition:
    opacity 400ms,
    box-shadow 400ms;
  translate: 0 -50%;
}

/* ---------- Top bar ---------- */

.top {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  left: max(16px, 5cqw);
  position: absolute;
  right: max(16px, 5cqw);
  top: max(16px, 3.4cqw);
}

.artemis-logo {
  display: block;
  height: max(24px, 2.3cqw);
  width: auto;
}


/* ---------- Headline (above the line) ---------- */

.headline {
  bottom: calc(100% - var(--horizon) + max(48px, 6.5cqw));
  left: max(16px, 5cqw);
  position: absolute;
  right: max(16px, 5cqw);
  transition: opacity 400ms;
}

h1 {
  font-family: var(--display);
  font-size: max(40px, 5.4cqw);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0;
  max-width: 14ch;
  text-wrap: balance;
}

/* ---------- The website field (below the line) ---------- */

.start {
  display: grid;
  gap: max(10px, 1.2cqw);
  left: max(16px, 5cqw);
  max-width: max(320px, 52cqw);
  position: absolute;
  right: max(16px, 5cqw);
  top: calc(var(--horizon) + max(36px, 5cqw));
  transition: top 1200ms var(--ease-out) 400ms;
}

.big-field {
  align-items: center;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgb(22 17 31 / 0.55);
  border-radius: max(10px, 1cqw);
  box-shadow: inset 0 0 0 1px rgb(255 252 249 / 0.16);
  display: flex;
  gap: 1cqw;
  height: max(56px, 5.2cqw);
  padding: 0 max(6px, 0.5cqw) 0 max(18px, 1.8cqw);
  transition: box-shadow 300ms;
}

.big-field:focus-within {
  box-shadow: inset 0 0 0 1px rgb(158 87 211 / 0.75);
}

.big-field input {
  background: transparent;
  border: 0;
  caret-color: var(--purple-100);
  color: var(--paper);
  flex: 1;
  font-size: max(18px, 1.75cqw);
  min-width: 0;
  outline: none;
}

.big-field input::placeholder {
  color: rgb(255 252 249 / 0.55);
}

.big-field button {
  background: var(--purple);
  border: 0;
  border-radius: max(7px, 0.7cqw);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  font-size: max(14px, 1.15cqw);
  font-weight: 600;
  height: calc(100% - max(12px, 1.1cqw));
  padding: 0 max(16px, 1.8cqw);
  transition:
    transform 120ms,
    opacity 150ms,
    background-color 150ms;
  white-space: nowrap;
}

.big-field button:hover:not(:disabled) {
  background: #7d17cc;
}

.big-field button:active:not(:disabled) {
  transform: scale(0.98);
}

.big-field button:disabled {
  background: rgb(255 252 249 / 0.08);
  color: rgb(255 252 249 / 0.55);
  cursor: default;
}

.big-field button:focus-visible,
.sample-button:focus-visible {
  outline: 2px solid var(--purple-100);
  outline-offset: 3px;
}

.reading {
  align-items: center;
  display: flex;
  font-family: var(--display);
  font-size: max(22px, 2.6cqw);
  font-weight: 500;
  gap: 1cqw;
  margin: 0;
}

.reading-dot {
  animation: pulse 1s ease-in-out infinite;
  background: var(--purple-300);
  border-radius: 9999px;
  flex-shrink: 0;
  height: max(10px, 1cqw);
  width: max(10px, 1cqw);
}

.reading[hidden],
.big-field[hidden],
.sample-button[hidden] {
  display: none;
}

.field-error {
  color: var(--purple-50);
  font-size: max(14px, 1.1cqw);
  margin: 0;
}

.field-error:empty {
  display: none;
}

.note {
  align-items: center;
  color: rgb(255 252 249 / 0.75);
  display: flex;
  flex-wrap: wrap;
  font-size: max(12px, 1cqw);
  gap: 0.75rem;
  text-shadow:
    0 1px 10px var(--ink),
    0 0 4px var(--ink);
  transition: opacity 400ms;
}

.sample-button {
  background: rgb(22 17 31 / 0.5);
  border: 1px solid rgb(255 252 249 / 0.25);
  border-radius: 9999px;
  color: var(--paper);
  cursor: pointer;
  font-size: max(12px, 0.95cqw);
  font-weight: 500;
  padding: 0.375rem 0.875rem;
  transition: background-color 150ms;
}

.sample-button:hover:not(:disabled) {
  background: rgb(255 252 249 / 0.1);
}

.sample-button:disabled {
  opacity: 0.4;
}

/* ---------- Reading: the line opens onto the house ---------- */

.stage.is-reading .field {
  opacity: 0;
  transition-delay: 1400ms;
}

.stage.is-reading .curtain {
  clip-path: inset(0 0 0 0);
}

.stage.is-reading .horizon {
  opacity: 0;
  transition: opacity 500ms 900ms;
}

.stage.is-reading .headline,
.stage.is-reading .note {
  opacity: 0;
  pointer-events: none;
}

.stage.is-reading .start {
  top: calc(100% - max(120px, 12cqw));
}

/* ---------- Motion ---------- */

@keyframes pulse {
  50% {
    opacity: 0.3;
    transform: scale(0.8);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stage *,
  .stage {
    animation: none !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
}
