/* What Moves Markets? - the carousel's identity (studio/assets/carousel-template.json) as a web page. */

@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("fonts/inter.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --ground: #000;
  --display: #fff;
  --text: #c9c9c9;
  --line: #5c5c5c;
  --accent: #ffd60a; /* the editor's pencil: every mark and the focus ring */

  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --stretch: .95; /* the template narrows display letters to 95 percent */
  --pad: clamp(24px, 6.5vw, 64px);

  color-scheme: dark;
}

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

html {
  background: var(--ground);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding: 0 var(--pad);
  background: var(--ground);
  color: var(--text);
  font: 400 17px/1.4 var(--sans);
  letter-spacing: -.02em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
p,
ul {
  margin: 0;
  padding: 0;
}

header,
.page {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
}

header {
  padding-top: clamp(28px, 6vh, 56px);
}

.brand {
  display: inline-block;
  color: var(--display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
}

.page {
  padding-block: clamp(44px, 7vh, 80px) clamp(40px, 8vh, 72px);
}

/* Headline: the closing slide. Sized so a line of up to 13 letters fits the column (6.62em once narrowed). */

.lead {
  container-type: inline-size;
}

.headline {
  width: calc(100% / var(--stretch));
  color: var(--display);
  font: 400 12.4vw/1 var(--mono);
  font-size: clamp(36px, 100cqi / 6.62, 104px);
  letter-spacing: -.06em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: scaleX(var(--stretch));
  transform-origin: 0 50%;
}

.headline > span {
  display: block;
}

.headline b {
  font-weight: 700;
}

/* Pencil marks. Generated by tools/marks.py; the SVG covers the word and draws outside it. */

.mark {
  position: relative;
  display: inline-block;
}

.pencil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.pencil path {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  animation: draw .9s cubic-bezier(.45, 0, .25, 1) .35s backwards;
}

@keyframes draw {
  0% {
    stroke-dashoffset: 1;
    opacity: 0;
  }

  1% {
    opacity: 1;
  }

  100% {
    stroke-dashoffset: 0;
  }
}

/* Text and links */

nav:not(:has(li)) {
  display: none;
}

.intro {
  max-width: 26em;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: -.025em;
  text-wrap: pretty;
}

.follow > .links {
  margin-top: 32px;
}

.label {
  margin: 40px 0 14px;
  color: var(--text);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.2;
}

.links {
  display: grid;
  gap: 10px;
  list-style: none;
}

.links a {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 16px;
  min-height: 76px;
  padding: 14px 20px 15px;
  border: 1px solid var(--line);
  color: var(--display);
  text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s;
}

.links b {
  grid-column: 1;
  font: 700 23px/1 var(--mono);
  letter-spacing: -.06em;
  text-transform: uppercase;
}

.links span {
  grid-column: 1;
  margin-top: 7px;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .15s;
}

.links a::after {
  content: "";
  grid-area: 1 / 2 / span 2;
  width: 34px;
  height: 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 257 123'%3E%3Cpath fill='none' stroke='%23000' stroke-width='15' stroke-linecap='round' stroke-linejoin='round' d='M7.8 65.1L19.9 63.3L31.9 61.5L44.0 59.8L56.1 58.2L68.2 56.8L80.2 55.7L92.3 54.7L104.4 54.0L116.4 53.6L128.5 53.4L140.6 53.6L152.7 54.0L164.7 54.7L176.8 55.7L188.9 56.8L200.9 58.2L213.0 59.8L225.1 61.5L237.1 63.3L249.2 65.1L196.0 7.8L249.2 65.1L205.2 115.0'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 257 123'%3E%3Cpath fill='none' stroke='%23000' stroke-width='15' stroke-linecap='round' stroke-linejoin='round' d='M7.8 65.1L19.9 63.3L31.9 61.5L44.0 59.8L56.1 58.2L68.2 56.8L80.2 55.7L92.3 54.7L104.4 54.0L116.4 53.6L128.5 53.4L140.6 53.6L152.7 54.0L164.7 54.7L176.8 55.7L188.9 56.8L200.9 58.2L213.0 59.8L225.1 61.5L237.1 63.3L249.2 65.1L196.0 7.8L249.2 65.1L205.2 115.0'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .15s;
}

/* The first link is the main one. */

.links li:first-child a {
  border-color: var(--display);
  background: var(--display);
  color: var(--ground);
}

.links li:first-child span {
  color: #4a4a4a;
}

@media (hover: hover) {
  .links a:hover {
    border-color: var(--display);
    background: var(--display);
    color: var(--ground);
  }

  .links a:hover span {
    color: #4a4a4a;
  }

  .links a:hover::after {
    transform: translateX(4px);
  }
}

.links a:active {
  border-color: var(--text);
  background: var(--text);
  color: var(--ground);
}

.links a:active span {
  color: #3a3a3a;
}

a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* Phone: one column */

.follow {
  margin-top: clamp(40px, 11vw, 56px);
}

/* Desktop: the headline on the left, the links on the right */

@media (min-width: 900px) {
  .page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
    align-items: center;
    column-gap: clamp(56px, 7vw, 112px);
  }

  .follow {
    margin-top: 0;
  }

  .brand {
    font-size: 20px;
  }

  .intro {
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pencil path {
    animation: none;
  }

  .links a,
  .links span,
  .links a::after {
    transition: none;
  }
}
