/* Archive Landing Page */

:root {
  --bg-base: #f7fbf9;
  --text-primary: #141414;
  --text-muted: #84908a;
  --font-ui: "Inter", system-ui, -apple-system, sans-serif;
  --layout-scale: 1;
  --intro-x: 292px;
  --intro-y: 35px;
  --intro-w: 439px;
  --logo-x: 180px;
  --logo-y: 343px;
  --logo-w: 225px;
  --headline-x: 579px;
  --headline-y: 349px;
  --headline-w: 276px;
  --form-x: 579px;
  --form-y: 448px;
  --form-w: 276px;
  --copyright-x: 82px;
  --copyright-y: 675px;
  --copyright-w: 187px;
  --social-x: 845px;
  --social-y: 675px;
  --social-w: 100px;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: only light;
  width: 100%;
  height: 100%;
}

body {
  min-height: 100dvh;
  min-height: 100svh;
  width: 100%;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}

#bgCanvas,
#sandCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  pointer-events: none;
}

#bgCanvas {
  z-index: 0;
}

#sandCanvas {
  z-index: 1;
  mix-blend-mode: multiply;
  opacity: 0.84;
  isolation: isolate;
}

.layout-viewport {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: transparent;
  pointer-events: none;
  isolation: isolate;
}

.layout-stage {
  transform: scale(var(--layout-scale));
  transform-origin: center center;
  will-change: transform;
  pointer-events: auto;
  flex-shrink: 0;
}

.layout-canvas {
  position: relative;
  width: 1024px;
  height: 728px;
  background: transparent;
}

.main-block {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.right-block {
  position: absolute;
  left: var(--headline-x);
  top: var(--headline-y);
  width: var(--headline-w);
  pointer-events: auto;
}

.brand-art {
  display: block;
  width: 100%;
  height: auto;
  filter: none;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.intro {
  position: absolute;
  left: var(--intro-x);
  top: var(--intro-y);
  width: var(--intro-w);
  line-height: 0;
}

.logo {
  position: absolute;
  left: var(--logo-x);
  top: var(--logo-y);
  width: var(--logo-w);
  line-height: 0;
  pointer-events: auto;
}

.headline {
  position: static;
  width: 100%;
  line-height: 0;
}

.waitlist-form {
  position: absolute;
  left: 0;
  top: calc(var(--form-y) - var(--headline-y));
  width: var(--form-w);
}

.site-footer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.copyright {
  position: absolute;
  left: var(--copyright-x);
  top: var(--copyright-y);
  width: var(--copyright-w);
  line-height: 0;
  pointer-events: auto;
}

.social {
  position: absolute;
  left: var(--social-x);
  top: var(--social-y);
  width: var(--social-w);
  line-height: 0;
  text-decoration: none;
  pointer-events: auto;
  transition: opacity 0.2s ease;
}

.waitlist-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.waitlist-field {
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(107, 117, 112, 0.35);
  transition: border-color 0.2s ease;
}

.waitlist-field:focus-within {
  border-color: rgba(26, 26, 26, 0.45);
}

.waitlist-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-primary);
  padding: 8px 0;
  min-width: 0;
}

.waitlist-input::placeholder {
  color: var(--text-muted);
}

.waitlist-submit {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-muted);
  padding: 0.5rem 0 0.5rem 0.75rem;
  transition: color 0.2s ease;
  line-height: 1;
  flex-shrink: 0;
}

.waitlist-submit:hover {
  color: var(--text-primary);
}

.waitlist-submit:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 4px;
  border-radius: 2px;
}

.waitlist-message {
  min-height: 0;
  margin-top: 0.45rem;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-muted);
}

.waitlist-message:empty {
  display: none;
}

.waitlist-success {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin-top: 0.4rem;
  line-height: 0;
}

.waitlist-success[hidden] {
  display: none;
}

.waitlist-message.is-error {
  color: #5c4a4a;
}

.social:hover {
  opacity: 0.6;
}

.social:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 4px;
  border-radius: 2px;
}

/* --- Mobile: grid layout (headline ? form ? archive logo) --- */

@media (max-width: 768px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .layout-viewport {
    position: relative;
    inset: auto;
    min-height: 100dvh;
    padding: clamp(24px, 5vw, 36px) clamp(20px, 5vw, 32px);
    align-items: stretch;
    overflow: visible;
  }

  .layout-stage {
    transform: none;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
  }

  .layout-canvas {
    width: 100%;
    height: auto;
    min-height: calc(100dvh - 48px);
    display: grid;
    grid-template-rows: auto auto minmax(80px, 20vh) auto 1fr auto auto;
    grid-template-columns: 1fr;
    justify-items: center;
    align-items: center;
    gap: 0;
    padding: 4px 0 12px;
  }

  .main-block {
    display: contents;
  }

  .right-block {
    display: contents;
  }

  .intro {
    grid-row: 1;
    position: static;
    width: 100%;
    max-width: 340px;
    margin: 0;
    align-self: end;
    padding-bottom: 14px;
  }

  .headline {
    grid-row: 2;
    position: static;
    width: 100%;
    max-width: 276px;
    margin: 28px 0 0;
    align-self: start;
  }

  .waitlist-form {
    grid-row: 4;
    position: static;
    width: 100%;
    max-width: 300px;
    align-self: start;
    margin-top: clamp(20px, 5vh, 36px);
  }

  .logo {
    grid-row: 6;
    position: static;
    width: min(225px, 58vw);
    margin: 0 0 clamp(24px, 6vh, 48px);
    align-self: end;
  }

  .site-footer {
    grid-row: 7;
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
    align-self: end;
    padding-top: 0;
  }

  .copyright,
  .social {
    position: static;
    width: auto;
  }

  .copyright-img {
    width: 187px;
    max-width: 100%;
  }

  .social-img {
    width: 100px;
  }

  #sandCanvas {
    opacity: 0.8;
  }
}

@media (prefers-reduced-motion: reduce) {
  #sandCanvas {
    opacity: 0.4;
  }
}
