/* Mind Muscle Millions — launch site
   Black and white only. Blacks sit slightly cold.
   One rule runs through the layout, taken from the logo: level edges stay
   level, upright edges lean the way the M's legs do (1 across for 10 down). */

:root {
  --pitch: #050608;   /* ground */
  --iron: #0c0e11;    /* raised surfaces */
  --seam: #22262b;    /* hairlines */
  --smoke: #454b53;   /* unlit type */
  --ash: #8a9098;     /* labels, secondary text */
  --chalk: #e6e9ec;   /* body text */
  --white: #fff;      /* logo, headlines, the button */

  --lean: -5.7106deg; /* atan(1/10), the angle of an M leg */

  --display: "Saira", "Archivo", "Arial Black", sans-serif;
  --text: "Archivo", system-ui, "Segoe UI", sans-serif;

  --gut: clamp(20px, 4vw, 56px);
  --nav: 68px;
  --slab: url(assets/tex/concrete.webp);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--pitch);
  color: var(--chalk);
  font: 400 17px/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
}

/* Film grain over everything. White specks only, so the logo stays clean. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background: url(assets/tex/grain.png) 0 0 / 256px;
  opacity: .055;
}

h1, h2, h3, p, figure { margin: 0; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

.defs { position: absolute; }

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

.skip {
  position: fixed;
  z-index: 200;
  top: 12px;
  left: 12px;
  padding: 12px 16px;
  background: var(--white);
  color: #000;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

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

/* Type ------------------------------------------------------------------ */

.display {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 900;
  line-height: .9;
  letter-spacing: .005em;
  text-transform: uppercase;
  color: var(--white);
}

.label {
  font: 600 11.5px/1.2 var(--text);
  font-stretch: 112%;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ash);
}

/* The mark -------------------------------------------------------------- */

.mark { color: var(--white); }
.mm { transition: fill .45s ease; }
.mm-1 { fill: var(--m1, currentColor); }
.mm-2 { fill: var(--m2, currentColor); }
.mm-3 { fill: var(--m3, currentColor); }

/* Button and field ------------------------------------------------------ */

.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 28px;
  border: 0;
  background: none;
  color: #000;
  font: 600 12px/1 var(--text);
  font-stretch: 112%;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color .2s;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--white);
  transform: skewX(var(--lean));
  transition: background-color .2s;
}
.btn:hover::before { background: #c9ced4; }
.btn:focus-visible { outline: 0; }
.btn:focus-visible::before { outline: 2px solid var(--white); outline-offset: 3px; }
.btn[disabled] { opacity: .6; cursor: default; }

.btn-line { height: 40px; padding: 0 18px; color: var(--white); }
.btn-line::before { background: transparent; box-shadow: inset 0 0 0 1px var(--white); }
.btn-line:hover { color: #000; }
.btn-line:hover::before { background: var(--white); }

.signup { width: 100%; max-width: 470px; }

.field {
  position: relative;
  isolation: isolate;
  display: flex;
  height: 52px;
}
.field::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 1px solid #5a6068;
  background: rgba(5, 6, 8, .55);
  transform: skewX(var(--lean));
  transition: border-color .2s, box-shadow .2s;
}
.field:focus-within::before { border-color: var(--white); box-shadow: 0 0 0 1px var(--white); }
.field input {
  flex: 1;
  width: 0; /* an input's built-in width would otherwise hold the form open on small screens */
  min-width: 0;
  height: 100%;
  padding: 0 20px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--white);
  font: 400 16px/1 var(--text);
  outline: 0;
}
.field input::placeholder { color: var(--ash); opacity: 1; }
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--white);
  transition: background-color 9999s;
}

/* On the narrowest phones the button gives a little room back to the field. */
@media (max-width: 380px) {
  .signup .btn { padding: 0 15px; letter-spacing: .1em; }
  .field input { padding: 0 14px; }
}

.status { min-height: 1.5em; margin-top: 10px; font-size: 14px; color: var(--ash); }
.status[data-kind="error"], .status[data-kind="ok"] { color: var(--white); font-weight: 600; }

/* Nav ------------------------------------------------------------------- */

.nav {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav);
  padding: 0 var(--gut);
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
  border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s;
}
.nav.is-stuck {
  background: rgba(5, 6, 8, .8);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--seam);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-right: auto;
  color: var(--white);
  text-decoration: none;
}
.brand .mark { width: 40px; }
.brand-name {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 900;
  font-size: 13.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* While a pillar is on screen, the nav logo lights only that M. */
[data-m="1"] .nav .mark { --m2: var(--smoke); --m3: var(--smoke); }
[data-m="2"] .nav .mark { --m1: var(--smoke); --m3: var(--smoke); }
[data-m="3"] .nav .mark { --m1: var(--smoke); --m2: var(--smoke); }

.nav-links { display: flex; gap: clamp(18px, 2.4vw, 32px); }
.nav-links a, .foot-links a, .follow a {
  position: relative;
  padding: 10px 0;
  font: 600 11.5px/1.2 var(--text);
  font-stretch: 112%;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--chalk);
}
.nav-links a::after, .foot-links a::after, .follow a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 1px;
  background: var(--white);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.nav-links a:hover::after, .nav-links a:focus-visible::after,
.foot-links a:hover::after, .foot-links a:focus-visible::after,
.follow a:hover::after, .follow a:focus-visible::after { transform: scaleX(1); }

/* Hero ------------------------------------------------------------------ */

.hero {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  min-height: 100svh;
  padding: calc(var(--nav) + 28px) var(--gut) clamp(32px, 6vh, 64px);
  display: grid;
  align-content: center;
  justify-items: center;
  row-gap: clamp(18px, 3vh, 32px);
  overflow: hidden;
  text-align: center;
}

/* The stage holds the logo. Its ::before is the strip behind everything: a
   column of concrete whose upright edges lean like the M's. It is kept near
   black so the logo is the lit thing on the screen. */
.hero-stage { display: grid; place-items: center; }
.hero-stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(56cqw, 840px);
  background:
    radial-gradient(ellipse 95% 58% at 50% 40%, #2e3136 0%, #1b1d20 45%, #0c0d0f 100%),
    var(--slab) center / cover;
  background-blend-mode: multiply;
  transform: translateX(-50%) skewX(var(--lean));
}

/* The logo, cut from the same concrete and lit from above. It is drawn as a
   mask of the logo file, so the shape is untouched and only the fill changes:
   light, over a wash that calms the slab, over the slab. */
.hero-mark {
  width: min(40cqw, 50svh, 560px);
  aspect-ratio: 1110.52 / 845.6;
  margin-bottom: clamp(4px, 1.5vh, 18px);
  background:
    linear-gradient(#fff, #8b9199),
    linear-gradient(rgba(206, 211, 217, .45), rgba(206, 211, 217, .45)),
    var(--slab) 40% 30% / max(62cqw, 520px) auto;
  background-blend-mode: multiply, normal, normal;
  -webkit-mask: url(assets/logos/mmm-rosary-white.svg) center / contain no-repeat;
  mask: url(assets/logos/mmm-rosary-white.svg) center / contain no-repeat;
}

.hero-title {
  font-size: clamp(11px, 1.45cqw, 19px);
  line-height: 1.4;
  letter-spacing: .5em;
  margin-right: -.5em;
}
.hero-title span { display: inline-block; }
.hero-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 22px;
  width: min(100%, 470px);
}
/* The brand's own line, from its Instagram bio. */
.hero-sub { font-size: clamp(15px, 6.4cqw, 34px); line-height: 1.1; letter-spacing: .02em; white-space: nowrap; }

@media (max-width: 860px) {
  .hero-stage::before { width: 84cqw; }
  .hero-mark { width: min(62cqw, 44svh); }
  .hero-title { font-size: clamp(11px, 3.3cqw, 18px); letter-spacing: .24em; margin-right: -.24em; }
}

/* Pillars --------------------------------------------------------------- */

.pillars { padding: clamp(72px, 10vw, 150px) var(--gut) clamp(48px, 7vw, 100px); }
.pillars > .label { margin-bottom: 22px; }

.pillar {
  display: grid;
  grid-template-columns: clamp(56px, 6.4vw, 92px) minmax(0, 1fr) minmax(0, 30ch);
  align-items: center;
  column-gap: clamp(20px, 3.4vw, 52px);
  padding: clamp(26px, 3.6vw, 52px) 0;
  border-top: 1px solid var(--seam);
}
.pillar:last-child { border-bottom: 1px solid var(--seam); }
/* A link to a pillar lands that row in the middle of the screen, not under
   the nav, because the middle is where the lit row sits. 110px is about half
   a row; anything within half a row of centre lights the right one. */
.pillar { scroll-margin-top: calc(50svh - var(--nav) - 110px); }

/* Each row's logo lights its own M. */
.pillar[data-m="1"] .mark { --m2: #2b2f35; --m3: #2b2f35; }
.pillar[data-m="2"] .mark { --m1: #2b2f35; --m3: #2b2f35; }
.pillar[data-m="3"] .mark { --m1: #2b2f35; --m2: #2b2f35; }

.pillar-word { font-size: clamp(42px, 9.6vw, 164px); }
.pillar-text { position: relative; padding-left: clamp(20px, 2.4vw, 36px); }
.pillar-text::before {
  content: "";
  position: absolute;
  left: 0;
  top: -14px;
  bottom: -14px;
  width: 1px;
  background: var(--smoke);
  transform: skewX(var(--lean));
}

/* With scripting on, the row nearest the middle of the screen is the lit one. */
.js .pillar-word { color: var(--smoke); transition: color .5s ease; }
.js .pillar-text { color: var(--ash); transition: color .5s ease; }
.js .is-lit .pillar-word { color: var(--white); }
.js .is-lit .pillar-text { color: var(--chalk); }

@media (max-width: 860px) {
  .pillar { grid-template-columns: 48px minmax(0, 1fr); column-gap: 18px; row-gap: 18px; }
  /* Sized so "Millions" (5.383em wide) always fits beside the logo. */
  .pillar-word { font-size: min(96px, calc((100vw - 2 * var(--gut) - 66px) / 5.45)); }
  .pillar-text { grid-column: 1 / -1; max-width: 40ch; }
}

/* Drop ------------------------------------------------------------------ */

.drop { padding: clamp(56px, 8vw, 120px) var(--gut); }

.drop-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px 40px;
  margin-bottom: clamp(24px, 3.4vw, 48px);
}
.drop-title { font-size: clamp(44px, 9.6vw, 164px); }
.drop-note { max-width: 30ch; color: var(--chalk); }

/* The pair of tiles is one leaning block; what's inside is set back upright. */
.lines {
  --tile: clamp(280px, 38vw, 560px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 calc(var(--tile) * .05);
  transform: skewX(var(--lean));
}
.line {
  position: relative;
  height: var(--tile);
  overflow: hidden;
  background: radial-gradient(ellipse 72% 78% at 50% 42%, #4a4f56 0%, #2e3136 42%, #17191c 100%), var(--slab) center / cover;
  background-blend-mode: multiply;
}
.line:nth-child(2) { background-position: center, 80% 20%; }
.line-in {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0 9% 13%;
  transform: skewX(calc(var(--lean) * -1));
}
.line-in .is-back { width: auto; height: calc(var(--tile) * .72); }
.line-in .is-front { width: 50%; }
.line figcaption {
  position: absolute;
  left: calc(var(--tile) * .05 + 22px);
  right: calc(var(--tile) * .05 + 22px);
  bottom: 22px;
  display: grid;
  gap: 6px;
  font-size: 15px;
  line-height: 1.4;
}

@media (max-width: 860px) {
  .lines { --tile: clamp(280px, 84vw, 460px); grid-template-columns: 1fr; }
  .line-in { padding-bottom: 20%; }
  .line-in .is-back { height: calc(var(--tile) * .68); }
}

/* Join ------------------------------------------------------------------ */

.join {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  align-items: end;
  gap: clamp(28px, 5vw, 80px);
  padding: clamp(80px, 12vw, 180px) var(--gut) clamp(64px, 9vw, 130px);
}
.join::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse 60% 90% at 22% 100%, #62676f 0%, #25282c 40%, #0a0b0d 74%, #050608 100%), var(--slab) center / cover;
  background-blend-mode: multiply;
}
.join-title { font-size: clamp(44px, 9.6vw, 164px); }
.join-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; padding-bottom: .6vw; }
.join-side > p { max-width: 32ch; }
.follow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; margin-top: 6px; }

@media (max-width: 860px) {
  .join { grid-template-columns: minmax(0, 1fr); }
  .join-title { font-size: clamp(40px, 13.4vw, 96px); }
}

/* Footer ---------------------------------------------------------------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding: 26px var(--gut) 30px;
  border-top: 1px solid var(--seam);
}
.foot .brand { margin-right: 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 26px; }
/* The maker's signature takes the footer's last row, full width. Its own
   styles arrive with its script; this only seats it in this footer. */
.foot .aaaa-sig-strip { flex: 0 0 100%; margin-top: 10px; padding-bottom: 0; }

@media (max-width: 860px) {
  .nav-links { display: none; }
}
@media (max-width: 480px) {
  .nav .brand-name { display: none; }
}

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

@media (prefers-reduced-motion: no-preference) {
  /* The light comes up, then the logo, then the name line by line. */
  .hero-stage::before { animation: lights 1.5s cubic-bezier(.3, .6, .2, 1) both; }
  .hero-mark { animation: rise .9s .2s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-title span { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-title span:nth-child(1) { animation-delay: .3s; }
  .hero-title span:nth-child(2) { animation-delay: .38s; }
  .hero-title span:nth-child(3) { animation-delay: .46s; }
  .hero-side { animation: rise .8s .68s cubic-bezier(.2, .7, .2, 1) both; }

  .rises .pillar, .rises .drop-head, .rises .line, .rises .join > * {
    opacity: 0;
    translate: 0 22px;
    transition: opacity .7s ease, translate .7s cubic-bezier(.2, .7, .2, 1);
  }
  .rises .line:nth-child(2) { transition-delay: .12s; }
  .rises .is-in, .rises .join.is-in > * { opacity: 1; translate: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; }
}

@keyframes lights { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } }
