/* The public landing page at `/`: a header with the sign-in link, a hero with
   a screenshot, feature call-outs (a picture beside some text, alternating
   sides) and a closing call to action. The screenshots come in a light and a
   dark version, picked with <picture> (see design/marketing-shots.mjs). */

.mk-wrap {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding-inline: var(--space-4);
}

.mk-header {
  padding-block: var(--space-4);
}

.mk-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.mk-header .wordmark {
  height: 2.5rem;
}

.mk-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.mk-login {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
}

.mk-login:hover {
  text-decoration: underline;
}

/* A link that looks like the app's buttons. */
a.btn {
  text-decoration: none;
}

.mk-hero {
  display: grid;
  gap: var(--space-6);
  justify-items: center;
  padding-block: var(--space-7) var(--space-6);
  text-align: center;
}

.mk-hero h1 {
  max-width: 20ch;
  font-size: var(--font-size-display);
}

.mk-tagline {
  max-width: 36rem;
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-lg);
}

.mk-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}

/* A screenshot in a window: a title bar with three dots, a hairline and a
   soft shadow. The picture inside is only the app, so the frame follows the
   theme and stays sharp at any size. */
.mk-window {
  width: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-bg-surface);
  box-shadow: var(--shadow-md);
}

.mk-window::before {
  content: "";
  display: block;
  box-sizing: content-box;
  width: 0.625rem;
  height: 0.625rem;
  margin: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  border-radius: var(--radius-full);
  background: var(--color-border-strong);
  box-shadow:
    1rem 0 0 var(--color-border-strong),
    2rem 0 0 var(--color-border-strong);
}

.mk-window img {
  display: block;
  width: 100%;
  height: auto;
  border-top: 1px solid var(--color-border-subtle);
}

.mk-hero .mk-window {
  max-width: 64rem;
}

.mk-features {
  display: grid;
  gap: var(--space-8);
  padding-block: var(--space-7);
}

.mk-feature {
  display: grid;
  align-items: center;
  gap: var(--space-5);
}

.mk-feature h2 {
  font-size: var(--font-size-xxl);
}

.mk-feature p {
  margin: var(--space-3) 0 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-lg);
}

@media (min-width: 48rem) {
  .mk-feature {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-7);
  }

  /* Every other call-out puts the picture on the right. */
  .mk-feature:nth-child(even) .mk-window {
    order: 2;
  }
}

.mk-cta {
  display: grid;
  gap: var(--space-4);
  justify-items: center;
  margin-block: var(--space-6) var(--space-8);
  padding-block: var(--space-7);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  background: var(--color-bg-surface);
  text-align: center;
}

.mk-cta h2 {
  font-size: var(--font-size-xxl);
}

.mk-cta p {
  max-width: 32rem;
  margin: 0;
  color: var(--color-text-secondary);
}

@media (max-width: 30rem) {
  .mk-hero {
    padding-block: var(--space-6) var(--space-5);
  }

  .mk-hero h1 {
    font-size: var(--font-size-xxl);
  }
}

/* A phone around a screenshot (iPhone 15 Pro proportions, 393 x 852): a dark
   body with a lighter rim, the Dynamic Island over the top of the picture, and
   a side button. Everything is in em, so setting `font-size` on the figure (or
   a parent) makes the whole phone bigger or smaller; 1em is 1/17 of its width. */
.mk-phone {
  position: relative;
  width: 17em;
  max-width: 100%;
  margin: 0 auto;
  padding: 0.55em;
  border-radius: 2.75em;
  background: var(--color-device-body);
  box-shadow:
    0 0 0 2px var(--color-device-rim),
    var(--shadow-md);
}

.mk-phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2.2em;
}

/* The Dynamic Island: 124 x 36 of the screen's 393 points across. */
.mk-phone::before {
  content: "";
  position: absolute;
  top: 1em;
  left: 50%;
  width: 5em;
  height: 1.45em;
  transform: translateX(-50%);
  border-radius: var(--radius-full);
  background: var(--color-device-body);
}

/* The side button. */
.mk-phone::after {
  content: "";
  position: absolute;
  top: 7em;
  right: -0.25em;
  width: 0.25em;
  height: 4em;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--color-device-rim);
}

/* A tablet (iPad proportions, 834 x 1194): the same body and rim, a thinner
   edge, and a camera dot. 1em is 1/25.6 of its width, so that a tablet and a
   phone at the same font-size are about the same height. */
.mk-tablet {
  position: relative;
  width: 25.6em;
  max-width: 100%;
  margin: 0;
  padding: 0.9em;
  border-radius: 2em;
  background: var(--color-device-body);
  box-shadow:
    0 0 0 2px var(--color-device-rim),
    var(--shadow-md);
}

.mk-tablet img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1.1em;
}

.mk-tablet::before {
  content: "";
  position: absolute;
  top: 0.3em;
  left: 50%;
  width: 0.35em;
  height: 0.35em;
  transform: translateX(-50%);
  border-radius: var(--radius-full);
  background: var(--color-device-rim);
}

/* Two devices side by side, bottom edges level. They are sized from the width
   of their column (a container query unit: 1cqw is 1% of the wrapper), so the
   pair always fits: 44.6em is the two devices and the gap between them. */
.mk-devices-wrap {
  container-type: inline-size;
}

.mk-devices {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2em;
  margin: 0;
  font-size: min(calc(100cqw / 44.6), 0.8rem);
}

.mk-devices .mk-phone {
  margin: 0;
}
