/* modeling.rulerattire.com
   White page, black Helvetica, one narrow column. Type follows the store:
   Helvetica, bold, uppercase, barely tracked. Built for a phone first. */

:root {
  --ink: #000000;
  --muted: #5c5c5c;
  --line: #c9c9c9;
  --wash: #f4f4f4;
  --paper: #ffffff;
  --error: #c0271f;
  --font: Helvetica, Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

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

button {
  font: inherit;
  color: inherit;
}

.page {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 24px 20px 56px;
}

/* ---------- Logo and progress ---------- */

.top {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Ruler's logo is its mark over the wordmark, so it is set narrower than a
   one-line wordmark would be. */
.top__logo {
  width: 112px;
  height: auto;
}

.steps {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-top: 22px;
}

.steps__bar {
  flex: 1 1 0;
  height: 2px;
  background: #e2e2e2;
  transition: background-color 0.3s ease;
}

.steps__bar.is-on {
  background: var(--ink);
}

/* ---------- Shared type ---------- */

.stage {
  margin-top: 28px;
}

.step {
  animation: rise 0.28s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.step--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 9vh;
  text-align: center;
}

.kicker {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
  text-transform: uppercase;
  text-wrap: balance;
}

.title--big {
  font-size: 40px;
  line-height: 1.02;
}

.sub {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.link {
  padding: 10px 6px;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link--quiet {
  color: var(--muted);
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 10px 16px;
  border: 0;
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.button[disabled] {
  opacity: 0.35;
  cursor: default;
}

.button.is-busy {
  opacity: 0.6;
}

.button:focus-visible,
.link:focus-visible,
.card:focus-visible,
.picked:focus-visible,
.drop:focus-within {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- 1. The pieces ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 12px;
  margin-top: 22px;
}

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}

.card__frame {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--wash);
}

.card__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.35s ease;
}

.card__name {
  margin-top: 9px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.card__cta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.card.is-picked .card__frame {
  box-shadow: inset 0 0 0 2px var(--ink);
}

.card.is-picked .card__cta {
  color: var(--ink);
  font-weight: 700;
}

@media (hover: hover) {
  .card:hover .card__image {
    transform: scale(1.04);
  }

  .button:not([disabled]):hover {
    opacity: 0.85;
  }
}

.card--ghost {
  aspect-ratio: 1 / 1.22;
  background: linear-gradient(var(--wash), var(--wash)) top / 100% 80% no-repeat;
  cursor: default;
  animation: breathe 1.2s ease-in-out infinite alternate;
}

@keyframes breathe {
  to {
    opacity: 0.55;
  }
}

/* ---------- 2. Phone number ---------- */

.picked {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 26px;
  padding: 8px;
  border: 1px solid #e2e2e2;
  border-radius: 2px;
  background: none;
  text-align: left;
  cursor: pointer;
}

.picked__image {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  background: var(--wash);
  object-fit: contain;
}

.picked__text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.picked__label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.picked__title {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.25;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.picked__change {
  flex: 0 0 auto;
  padding-right: 6px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Postscript's form draws itself in here. Room is held for it so the page does
   not jump when it arrives, and it stays out of sight until it has settled on
   the phone field. */
.sms {
  min-height: 190px;
  margin-top: 18px;
}

.sms.is-settling {
  visibility: hidden;
}

/* ---------- 3. Instagram and fit pic ---------- */

.form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 22px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.field__box {
  display: flex;
  align-items: center;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
}

.field__box:focus-within {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.field__at {
  padding-left: 14px;
  color: var(--muted);
  font-size: 16px;
}

.field__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 52px;
  padding: 0 14px 0 4px;
  border: 0;
  outline: 0;
  background: none;
  color: var(--ink);
  font-family: var(--font);
  /* 16px keeps an iPhone from zooming the page when the field is tapped. */
  font-size: 16px;
}

.field__input::placeholder {
  color: #a3a3a3;
}

.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 190px;
  overflow: hidden;
  border: 1px dashed #a9a9a9;
  border-radius: 2px;
  background: #fafafa;
  cursor: pointer;
}

.drop.is-filled {
  border-style: solid;
  border-color: var(--line);
  background: var(--wash);
}

/* The real file field covers the whole box, so a tap anywhere opens the
   phone's own picker with nothing in between. */
.drop__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 16px;
}

.drop__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.drop__plus {
  font-size: 34px;
  font-weight: 300;
  line-height: 1;
}

.drop__text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.drop__filled {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  pointer-events: none;
}

.drop__preview {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
}

.drop__name {
  padding: 28px 16px 0;
  font-size: 14px;
  overflow-wrap: anywhere;
  text-align: center;
}

.drop__change {
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.drop__progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: #e2e2e2;
}

.drop__progress-bar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ink);
  transition: width 0.25s ease;
}

.error {
  margin: -6px 0 0;
  color: var(--error);
  font-size: 14px;
}

/* ---------- 4. Countdown ---------- */

.count {
  margin: 6px 0 0;
  font-size: 132px;
  font-variant-numeric: tabular-nums;
  font-weight: 300;
  line-height: 1;
}

.count.is-tick {
  animation: tick 0.5s ease;
}

@keyframes tick {
  from {
    opacity: 0;
    transform: scale(1.12);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 5 and 6. Congrats, and the end ---------- */

.deal {
  margin: 18px 0 0;
  font-size: 18px;
  line-height: 1.35;
}

.deal strong {
  font-weight: 700;
}

.when {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 16px;
  padding: 18px 16px 14px;
  border: 1px dashed var(--ink);
  border-radius: 2px;
  background: none;
  cursor: pointer;
}

.code__text {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
}

.code__hint {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.step--center > .sub {
  margin-top: 16px;
}

.choices {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 34px;
}

.step--center > .link {
  margin-top: 26px;
}

.noscript {
  padding: 24px;
  text-align: center;
}

@media (min-width: 600px) {
  .page {
    padding-top: 44px;
  }

  .title {
    font-size: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .step,
  .count.is-tick,
  .card--ghost {
    animation: none;
  }

  .card__image,
  .steps__bar,
  .drop__progress-bar {
    transition: none;
  }
}
