/* markdownmini.com home page. Builds on the site styles (styles.css,
   article.css) inherited from eliseys.com and the editor window (app/window.css). */

.page-shell--article { padding-top: clamp(40px, 7vw, 112px); }

/* Intro -------------------------------------------------------------------- */

.intro {
  --title-size: min(220px, calc((100vw - 2 * var(--page-x)) / 6.75));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: clamp(64px, 8vw, 128px);
}

.intro__deck {
  max-width: 34rem;
  margin: 0 0 clamp(16px, 1.6vw, 22px);
  font-size: clamp(20px, 1.6vw, 26px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.3;
  color: var(--text);
  text-wrap: balance;
}

.intro__meta { justify-content: center; }

.store-badge { display: inline-block; line-height: 0; flex-shrink: 0; }
.store-badge img { height: 40px; width: auto; display: block; }
.intro .store-badge { margin-top: clamp(20px, 2vw, 28px); }

.intro__title {
  position: relative;
  z-index: 1;
  margin: clamp(28px, 4vw, 64px) 0 0;
  font-size: var(--title-size);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 0.92;
  white-space: nowrap;
}

/* The window rises into the lower part of the title. */
.intro__app {
  width: 100%;
  margin-top: calc(var(--title-size) * -0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.intro__hint {
  margin: 18px 0 0;
  font-size: var(--article-meta-size);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--article-ink-3);
}
.intro__hint a { color: var(--text); text-decoration: underline; text-decoration-color: var(--article-underline); text-underline-offset: 0.2em; }
.intro__hint a:hover { text-decoration-color: currentColor; }

.intro__shot { position: relative; z-index: 2; display: block; width: 100%; }
.intro__shot img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.22)) drop-shadow(0 0 0.5px rgba(0, 0, 0, 0.4));
}
.intro__web { margin-top: clamp(24px, 6vw, 32px); }

/* The live window on desktops, the picture on phones and tablets. Mirrors
   the query in app/app.js, which only loads the editor when it is shown. */
.intro__app .intro__shot, .intro__app .intro__web { display: none; }
@media (max-width: 700px), (pointer: coarse) and (max-width: 1100px) {
  .intro__app .window, .intro__app .intro__hint { display: none; }
  .intro__app .intro__shot { display: block; }
  .intro__app .intro__web { display: inline-flex; }
}

/* "Try on the Web": the same size and shape as Apple's badge next to it. */
.web-badge {
  height: 40px;
  min-width: 156px;
  padding: 0 14px 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 7px;
  border: 1px solid #a6a6a6;
  background: #000;
  color: #fff;
  font: 600 15px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: opacity 160ms ease;
}
.web-badge:hover { opacity: 0.82; }
.web-badge svg { flex-shrink: 0; }

/* Body -------------------------------------------------------------------- */

.article__body > p:nth-child(-n+2) {
  font-size: clamp(20px, 1.6vw, 24px);
  letter-spacing: -0.02em;
  line-height: 1.4;
}
.article__body > p:nth-child(2) { margin-top: 0.8em; }

/* Closing call to action ---------------------------------------------------- */

.article { padding-bottom: 0; }

.closing {
  width: min(100%, 60rem);
  margin: clamp(72px, 9vw, 140px) auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.closing__title {
  margin: 0;
  font-size: clamp(40px, 5vw, 72px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
  text-wrap: balance;
}
.closing__text {
  margin: 16px 0 0;
  font-size: var(--article-meta-size);
  color: var(--article-ink-3);
}
.closing__text a { color: inherit; text-decoration: underline; text-decoration-color: var(--article-underline); text-underline-offset: 0.2em; }
.closing__buttons {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

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

.site-footer {
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: clamp(72px, 9vw, 140px);
  padding: clamp(20px, 2vw, 28px) 0 clamp(24px, 2.4vw, 40px);
  border-top: 1px solid rgba(var(--text-rgb), 0.14);
  animation: none;
}
.site-footer__meta { display: flex; align-items: baseline; gap: clamp(16px, 2vw, 32px); }
.site-footer .topbar__home { font-weight: 500; }
.site-footer__link { color: rgba(var(--text-rgb), 0.58); transition: color 180ms ease; }
.site-footer__link:hover { color: var(--text); }

/* The page rises in without fading: text that starts transparent is not
   counted as painted, which held back Largest Contentful Paint. */
.article {
  animation-name: rise-in-solid;
}

@keyframes rise-in-solid {
  from { transform: translateY(20px); }
  to { transform: translateY(0); }
}
