/* Sign-in motion. One sticky stage; scrolling the page moves the polaroids.
   The home log does not import this file. */

@import url("tokens.css");

html:has(body.login-strata) {
  height: auto;
  overflow: auto;
  scroll-behavior: auto;
}

body.login-strata {
  display: block;
  max-width: none;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
  touch-action: auto;
  background: #efe9df;
  color: #1d1a16;
}

body.login-strata.auth-shell::before {
  display: none;
}

body.login-strata .login-card {
  animation: none;
  margin: 0;
  width: auto;
  max-width: none;
  padding: 30px 28px 26px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.strata-track {
  height: 520vh;
}

.strata-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: #efe9df;
}

.strata-glow {
  position: absolute;
  inset: -30%;
  pointer-events: none;
  background: radial-gradient(38% 30% at 30% 30%, rgba(255, 244, 222, 0.9), transparent 70%);
  animation: strata-drift 22s ease-in-out infinite alternate;
}

@keyframes strata-drift {
  to { transform: translate(28%, 18%); }
}

.strata-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  mix-blend-mode: multiply;
  background-image: var(--grain);
}

.strata-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 24px 18px;
}

.strata-top .left {
  display: flex;
  align-items: center;
}

.strata-brand {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.01em;
  opacity: 0;
}

.strata-top a,
.strata-replay {
  color: #1d1a16;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: #d6cdbf;
}

.strata-replay {
  display: none;
  margin-left: 14px;
  width: auto;
  background: none;
  border: 1px solid #d6cdbf;
  border-radius: 999px;
  color: #857d71;
  font: 13px var(--font-body);
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  padding: 6px 12px;
  box-shadow: none;
}

.strata-replay.is-on {
  display: inline-block;
}

.strata-hero {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  pointer-events: none;
  z-index: 2;
  padding: 0 24px;
}

.strata-hero h1 {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(44px, 8.4vw, 128px);
  letter-spacing: -0.035em;
  line-height: 0.95;
  margin: 0;
  max-width: none;
  color: #1d1a16;
}

.strata-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.08em;
}

.strata-word > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

body.login-strata.is-in .strata-word > span {
  transform: none;
}

.strata-hero p {
  margin: 20px 0 0;
  color: #857d71;
  font-size: clamp(14px, 1.2vw, 17px);
  opacity: 0;
  transition: opacity 1.2s 1s;
}

body.login-strata.is-in .strata-hero p {
  opacity: 1;
}

.strata-caption {
  position: absolute;
  left: 0;
  right: 0;
  top: 17%;
  text-align: center;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  padding: 0 24px;
}

.strata-caption h2 {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(34px, 4.6vw, 64px);
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1;
  color: #1d1a16;
}

.strata-caption p {
  margin: 12px auto 0;
  color: #857d71;
  font-size: 15px;
  max-width: 40ch;
  line-height: 1.5;
}

.strata-cards {
  position: absolute;
  inset: 0;
  z-index: 1;
  perspective: 1100px;
  perspective-origin: 50% 46%;
  transform-style: preserve-3d;
  overflow: visible;
}

.strata-floor {
  position: absolute;
  width: min(460px, 72vw);
  height: 54px;
  margin-left: calc(min(460px, 72vw) / -2);
  margin-top: -20px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(70, 52, 28, 0.28), transparent 72%);
  pointer-events: none;
  opacity: 0;
  z-index: 0;
}

.strata-polaroid {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--w);
  height: calc(var(--w) * 1.22);
  margin: 0;
  padding: calc(var(--w) * 0.065) calc(var(--w) * 0.065) calc(var(--w) * 0.25);
  background: #faf6ef;
  border: 0;
  border-radius: 0;
  box-shadow:
    0 1px 1px rgba(70, 52, 28, 0.12),
    0 calc(8px + var(--lift, 12) * 0.45px) calc(16px + var(--lift, 12) * 0.85px) rgba(70, 52, 28, 0.18);
  will-change: transform;
  transform-style: preserve-3d;
  pointer-events: none;
  backface-visibility: hidden;
}

.strata-polaroid.strata-flip {
  width: var(--w);
  height: calc(var(--w) * 1.22);
  padding: 0;
  /* The faces carry the paper. A fill here stays facing you and reads as a white sheet behind the turn. */
  background: transparent;
  box-shadow: none;
  backface-visibility: visible;
  -webkit-backface-visibility: visible;
  pointer-events: none;
}

.strata-polaroid.strata-flip.is-ready {
  pointer-events: auto;
}

.strata-tilt,
.strata-flip-scene,
.strata-flip-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
}

.strata-flip-scene {
  perspective: 1000px;
}

.strata-face {
  position: absolute;
  inset: 0;
  background: #faf6ef;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

.strata-face-front {
  display: flex;
  flex-direction: column;
  padding: calc(var(--w) * 0.065) calc(var(--w) * 0.065) calc(var(--w) * 0.25);
  box-shadow:
    0 1px 1px rgba(70, 52, 28, 0.12),
    0 calc(8px + var(--lift, 12) * 0.45px) calc(16px + var(--lift, 12) * 0.85px) rgba(70, 52, 28, 0.2);
}

.strata-face-back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  background: #faf6ef;
  overflow: visible;
}

.strata-face-front .strata-photo {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  background: #d5bd99;
}

.strata-face-front .strata-photo svg {
  background: #d5bd99;
}

.strata-face-front .strata-cap {
  bottom: calc(var(--w) * 0.075);
  font-size: calc(var(--w) * 0.078);
}

.strata-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: var(--sheen, 0);
  background: radial-gradient(
    420px 260px at var(--mx, 50%) var(--my, 28%),
    rgba(255, 252, 245, 0.62),
    transparent 62%
  );
  mix-blend-mode: soft-light;
}

.strata-polaroid:hover {
  border-color: transparent;
  box-shadow:
    0 1px 2px rgba(70, 52, 28, 0.18),
    0 22px 44px -20px rgba(70, 52, 28, 0.18);
}

.strata-photo {
  position: relative;
  width: 100%;
  height: 100%;
  background: #e4dccf;
  overflow: hidden;
}

.strata-photo svg,
.strata-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: grayscale(1) sepia(0.7) brightness(1.3) contrast(0.6) blur(2px);
}

.strata-polaroid.is-dev .strata-photo svg,
.strata-polaroid.is-dev .strata-photo img {
  opacity: 1;
  filter: none;
  transition:
    opacity 1.6s cubic-bezier(0.22, 1, 0.36, 1),
    filter 3.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.strata-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--w) * 0.075);
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: calc(var(--w) * 0.078);
  line-height: 1;
  color: #857d71;
  opacity: var(--cap, 0);
}

.strata-login {
  position: absolute;
  left: 0;
  top: 0;
  width: min(360px, 86vw);
  margin: 0;
  z-index: 10;
  visibility: hidden;
  backface-visibility: hidden;
}

body.login-strata .strata-face-back .strata-login {
  position: relative;
  left: 0;
  top: 0;
  right: auto;
  bottom: auto;
  width: 100%;
  height: auto;
  margin: 0;
  visibility: visible;
  z-index: 1;
  transform: none;
  backface-visibility: hidden;
}

body.login-strata .strata-face-back .login-card {
  width: 100%;
  height: auto;
  margin: 0;
  box-shadow:
    0 1px 1px rgba(70, 52, 28, 0.12),
    0 calc(14px + var(--lift, 20) * 0.4px) calc(28px + var(--lift, 20) * 0.7px) rgba(70, 52, 28, 0.2);
}

.strata-login .login-card {
  position: relative;
  z-index: 1;
  background: #faf6ef;
  box-shadow:
    0 1px 2px rgba(70, 52, 28, 0.18),
    0 34px 70px -26px rgba(70, 52, 28, 0.18);
}

.strata-mark {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: #857d71;
}

body.login-strata .strata-login h2 {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 34px;
  letter-spacing: -0.025em;
  margin: 12px 0 6px;
  color: #1d1a16;
}

.strata-login .lede,
.strata-login .hint {
  margin: 0 0 16px;
  color: #857d71;
  font-size: 14px;
  line-height: 1.5;
}

.strata-login label {
  display: block;
  font-size: 13px;
  color: #857d71;
  margin-bottom: 16px;
}

body.login-strata .strata-login input {
  display: block;
  width: 100%;
  margin-top: 4px;
  font: 15px var(--font-body);
  color: #1d1a16;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #d6cdbf;
  border-radius: 0;
  padding: 9px 0;
  box-shadow: none;
  transition: border-color 0.35s;
}

body.login-strata .strata-login input:focus,
body.login-strata .strata-login input:focus-visible {
  outline: none;
  border-bottom-color: #1d1a16;
  box-shadow: none;
}

.strata-pw {
  position: relative;
  display: block;
}

.strata-pw input {
  padding-right: 54px;
}

.strata-toggle,
body.login-strata .strata-login button.linkish,
body.login-strata .strata-login button.linkbtn,
.strata-login .linkish,
.strata-login .linkbtn {
  width: auto;
  background: none;
  border: 0;
  border-radius: 0;
  color: #1d1a16;
  font: 14px var(--font-body);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: #d6cdbf;
  box-shadow: none;
  padding: 0;
  cursor: pointer;
}

.strata-toggle {
  position: absolute;
  right: 0;
  bottom: 8px;
  color: #857d71;
  font-size: 13px;
  text-decoration: none;
}

body.login-strata .strata-login button.linkish,
body.login-strata .strata-login button.linkbtn,
.strata-login .linkish,
.strata-login .linkbtn {
  display: block;
  margin: 18px auto 0;
}

.strata-login #login-msg {
  color: #9a3b2a;
  margin: -4px 0 12px;
}

.strata-login #login-msg:empty {
  display: none;
  margin: 0;
}

.strata-login .primary {
  position: relative;
  overflow: hidden;
  width: 100%;
  margin-top: 6px;
  padding: 15px;
  border: 0;
  border-radius: 0;
  background: #1d1a16;
  color: #faf6ef;
  font: 500 14px var(--font-body);
  letter-spacing: 0.02em;
  text-transform: none;
  box-shadow: none;
}

.strata-login .primary::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: #faf6ef;
  opacity: 0.7;
}

.strata-login .primary.is-busy::after {
  width: 100%;
  transition: width 1s linear;
}

.strata-sent {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(210px, 62%);
  background: #faf6ef;
  padding: 9px 9px 12px;
  z-index: 0;
  box-shadow:
    0 1px 2px rgba(70, 52, 28, 0.18),
    0 20px 40px -18px rgba(70, 52, 28, 0.18);
  opacity: 0;
  transform: translate(-50%, -10px);
  transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s;
}

.strata-sent.is-on {
  opacity: 1;
  transform: translate(-50%, calc(100% - 14px)) rotate(-3deg);
}

.strata-sent .strata-photo {
  height: 96px;
}

.strata-sent.is-on .strata-photo svg {
  opacity: 1;
  filter: none;
  transition: opacity 1.4s 0.4s, filter 3s 0.4s;
}

.strata-sent p {
  margin: 9px 2px 0;
  font: italic 400 13px/1.35 var(--font-display);
  color: #857d71;
  text-align: center;
}

.strata-bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 0 24px calc(22px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}

.strata-scroll-hint {
  text-align: center;
  font-size: 13px;
  color: #857d71;
  margin-bottom: 18px;
}

.strata-scroll-hint i {
  display: block;
  width: 1px;
  height: 26px;
  margin: 8px auto 0;
  background: linear-gradient(#857d71, transparent);
  animation: strata-hint 2s ease-in-out infinite;
}

@keyframes strata-hint {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

.strata-steps {
  max-width: 420px;
  margin: 0 auto;
}

.strata-steps ol {
  display: flex;
  justify-content: space-between;
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  font-size: 13px;
  color: #857d71;
}

.strata-steps li.is-on {
  color: #1d1a16;
}

.strata-bar {
  height: 1px;
  background: #d6cdbf;
  position: relative;
}

.strata-bar b {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: #1d1a16;
  width: 0;
}

@media (prefers-reduced-motion: reduce) {
  .strata-track { height: 100svh; }
  .strata-glow,
  .strata-scroll-hint i { animation: none; }
  .strata-scroll-hint,
  .strata-steps { display: none; }
  .strata-word > span,
  .strata-hero p { transition: none; }
}
