@font-face {
  font-family: "Montserrat Alternates";
  src: url("assets/fonts/montserrat-alternates-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Montserrat Alternates";
  src: url("assets/fonts/montserrat-alternates-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Montserrat Alternates";
  src: url("assets/fonts/montserrat-alternates-semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --callo-blue: #acbccd;
  --callo-white: #ffffff;
  --callo-black: #44474a;
  --callo-yellow: #fcfcd9;
  --callo-pink: #f16683;
  --callo-sky: #96c7eb;
  --callo-deep: #5f7689;
  --imessage: #0a84ff;

  --ground: var(--callo-blue);
  --ink: var(--callo-black);
  --ink-soft: var(--callo-black);
  --rule: rgba(68, 71, 74, 0.3);
  --brace: var(--callo-pink);
  --highlighter: var(--callo-yellow);
  --highlighter-hover: #f4f4bd;
  --field: rgba(255, 255, 255, 0.86);
  --field-edge: rgba(68, 71, 74, 0.16);
  --tapback-edge: var(--callo-blue);
  --texture: url("assets/texture-blue.webp");

  /* Type scales with the shorter of width and height, so the page always fits one screen. */
  --text: clamp(15px, min(5.1vw, 2.55svh), 24px);
  --column: 41rem;
  --leading: 1.3;
  --space-xs: 8px;
  --space-reg: 16px;
  --space-xl: 20px;
  --space-6xl: 64px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-pop: linear(0, 0.092, 0.296, 0.528, 0.736, 0.897, 1.004, 1.063, 1.085, 1.084, 1.068, 1.049, 1.029, 1.014, 1.003, 0.996, 0.993, 0.993, 0.993, 0.995, 0.997, 0.998, 0.999, 1);
  --reaction-hidden-scale: 0;

  --display: "neulis-cursive", "Montserrat Alternates", ui-rounded, system-ui, sans-serif;
  --body: "Montserrat Alternates", ui-rounded, system-ui, sans-serif;

  color-scheme: only light;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --reaction-hidden-scale: 1;
  }
}

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

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

html,
body {
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: var(--space-reg);
  position: relative;
  isolation: isolate;
  background-color: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--text);
  line-height: var(--leading);
  letter-spacing: -0.01em;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  caret-color: var(--imessage);
}

/* The guideline's canvas, held back to a whisper so the type leads. */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100lvh;
  z-index: -1;
  background-image: var(--texture);
  background-size: cover;
  background-position: center;
  opacity: 0.38;
  pointer-events: none;
}

::selection {
  background: var(--callo-sky);
  color: var(--callo-black);
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
  border-radius: 4px;
}

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

/* The home page is one screen, like instinct: it never scrolls on a normal phone or desktop. */
body:has(.home) {
  min-height: 100svh;
  height: 100dvh;
}

/* ---------- header ---------- */

.site-header {
  padding: 4px 0 0;
  flex-shrink: 0;
}
.site-header__home {
  display: block;
  width: fit-content;
  color: var(--ink);
}
.site-header__home svg {
  display: block;
  width: 40px;
  height: auto;
}

/* ---------- home ---------- */

.home {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  min-height: 0;
  gap: clamp(16px, 4svh, 64px);
  padding: clamp(12px, 4.5svh, 64px) 0 4px;
}

.home__intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: min(calc(var(--text) * 1.9), 4.4svh);
  max-width: var(--column);
}

.home__intro > * {
  text-wrap: pretty;
}

.home__lead {
  font-family: var(--display);
  font-weight: 400;
  font-size: calc(var(--text) * 1.08);
  line-height: 1.28;
  letter-spacing: 0;
}

.home__lead-group {
  display: flex;
  flex-direction: column;
  gap: min(calc(var(--text) * 0.55), 1.4svh);
}

.brace {
  color: var(--brace);
  padding-inline: 0.02em;
}

/* ---------- tasks + tapbacks ---------- */

.home__examples {
  position: relative;
}
.home__texts {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: min(calc(var(--text) * 0.3), 0.9svh);
  margin-top: min(calc(var(--text) * 0.5), 1.2svh);
}
.home__closing {
  margin-bottom: min(calc(var(--text) * 0.35), 1svh);
}

.task {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: inherit;
  display: inline;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: calc(0.12em + 1px);
  text-decoration-color: var(--rule);
  transition: text-decoration-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.task:focus-visible {
  outline-offset: 3px;
}
@media (hover: hover) {
  .task:hover {
    text-decoration-color: var(--ink);
  }
}
.task[aria-pressed="true"] {
  text-decoration-color: var(--ink);
  text-decoration-thickness: 2px;
}

.reaction-anchor {
  position: absolute;
  left: var(--reaction-x, 0);
  top: var(--reaction-y, 0);
  pointer-events: none;
}

/* iMessage tapback: a blue bubble with its two trailing dots */
.tapback {
  position: absolute;
  bottom: 4px;
  left: -4px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--imessage);
  color: #fff;
  box-shadow: 0 0 0 2.5px var(--tapback-edge), 0 6px 14px -6px rgba(0, 0, 0, 0.3);
  opacity: 0;
  scale: var(--reaction-hidden-scale);
  transform-origin: 0 100%;
  transition: scale 0s 0.15s, opacity 0.15s;
}
.tapback::before,
.tapback::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: var(--imessage);
  box-shadow: 0 0 0 2px var(--tapback-edge);
}
.tapback::before {
  width: 9px;
  height: 9px;
  left: 1px;
  bottom: -3px;
}
.tapback::after {
  width: 4.5px;
  height: 4.5px;
  left: -5px;
  bottom: -8px;
}
.tapback svg {
  position: relative;
  z-index: 1;
  width: 17px;
  height: 17px;
  display: block;
  scale: var(--reaction-hidden-scale);
}
.tapback .tapback__text {
  position: relative;
  z-index: 1;
  font-family: ui-rounded, system-ui, sans-serif;
  font-weight: 800;
  font-size: 11px;
  line-height: 0.9;
  letter-spacing: -0.02em;
  text-align: center;
  scale: var(--reaction-hidden-scale);
}

.is-reacting .tapback {
  opacity: 1;
  scale: 1;
  transition: scale 0.5s var(--ease-pop), opacity 0.12s;
}
.is-reacting .tapback :is(svg, .tapback__text) {
  scale: 1;
  transition: scale 0.43s 0.07s var(--ease-pop);
}
@media (hover: hover) {
  .task:hover .tapback {
    opacity: 1;
    scale: 1;
    transition: scale 0.5s var(--ease-pop), opacity 0.12s;
  }
  .task:hover .tapback :is(svg, .tapback__text) {
    scale: 1;
    transition: scale 0.43s 0.07s var(--ease-pop);
  }
}

/* ---------- CTA + first text ---------- */

.home__cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: min(calc(var(--text) * 0.9), 2.2svh);
  width: 100%;
}

.cta {
  font-family: var(--display);
  font-weight: 700;
  font-size: calc(var(--text) * 1.08);
  text-decoration: underline 0.42em var(--highlighter);
  text-underline-offset: -0.2em;
  text-decoration-skip-ink: none;
  transition: text-decoration-color 0.15s;
}
@media (hover: hover) {
  .cta:hover {
    text-decoration-color: var(--highlighter-hover);
  }
}
.cta__chevron {
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-left: 0.12em;
  vertical-align: -0.1em;
}
.cta__chevron svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* iMessage compose field: what the first text will say */
.compose {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  width: min(100%, 27rem);
  min-height: 44px;
  padding: 6px 6px 6px 16px;
  border-radius: 22px;
  background: var(--field);
  box-shadow: inset 0 0 0 1px var(--field-edge), 0 10px 30px -18px rgba(0, 0, 0, 0.32);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  backdrop-filter: saturate(1.4) blur(18px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", var(--body);
  font-size: 17px;
  line-height: 1.32;
  letter-spacing: -0.02em;
  color: var(--ink);
  transition: box-shadow 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
@media (hover: hover) {
  .compose:hover {
    box-shadow: inset 0 0 0 1px var(--field-edge), 0 14px 34px -16px rgba(0, 0, 0, 0.38);
  }
}
.compose:active {
  transform: scale(0.985);
}
.compose__text {
  flex: 1;
  padding: 5px 0;
  min-height: 1.32em;
  overflow-wrap: anywhere;
}
.compose__caret {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  margin-left: 1px;
  vertical-align: -0.2em;
  border-radius: 1px;
  background: var(--imessage);
  animation: caret 1.05s steps(1) infinite;
}
@keyframes caret {
  50% {
    opacity: 0;
  }
}
.compose__send {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--imessage);
  color: #fff;
}
.compose__send svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* Asides in Callo White, as the guideline sets white on Callo Blue. */
.home__aside,
.home__note {
  color: var(--callo-white);
}

.home__note {
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0;
}

/* ---------- footer ---------- */

.legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) 24px;
  font-size: 13px;
  line-height: 1.02;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--ink);
}
.legal-links__list {
  display: flex;
  gap: 24px;
}
.legal-links a {
  position: relative;
}
.legal-links a::after {
  content: "";
  position: absolute;
  inset: -16px -8px;
}
@media (hover: hover) {
  .legal-links a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}

@media (min-width: 80rem) {
  body {
    padding: 20px var(--space-xl);
  }
  .site-header {
    padding-top: 0;
  }
  .home {
    padding-top: var(--space-6xl);
  }
  .legal-links {
    font-size: 15px;
  }
}

/* ---------- entrance: one staggered reveal, as instinct does it ---------- */

.reveal {
  animation: reveal 0.6s var(--ease-out) calc(var(--reveal, 0) * 90ms) both;
}
@keyframes reveal {
  from {
    opacity: 0;
    translate: 0 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: reveal-fade 0.3s both;
  }
  @keyframes reveal-fade {
    from {
      opacity: 0;
    }
  }
  .compose__caret {
    animation: none;
  }
}

/* ---------- legal pages ---------- */

.legal-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-6xl);
  flex: 1;
  padding: calc(var(--space-6xl) - 20px) 0 4px;
}
.legal {
  max-width: var(--column);
  display: flex;
  flex-direction: column;
  gap: 1.1em;
  font-size: clamp(16px, 4.2vw, 18px);
  line-height: 1.5;
}
.legal h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: calc(var(--text) * 1.08);
  line-height: 1.25;
  margin-bottom: 0.2em;
}
.legal h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05em;
  margin-top: 1.4em;
}
.legal ul,
.legal ol {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding-left: 1.1em;
}
.legal a {
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
}
.legal .updated {
  color: var(--ink-soft);
  font-size: 0.9em;
}
.legal-page .legal-links {
  margin-top: auto;
}
.legal .step p {
  position: relative;
  padding-left: 2.4em;
}
.legal .step-num {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  background: var(--ink);
  color: var(--ground);
  font-size: 0.8em;
  font-weight: 600;
  line-height: 1;
}

/* Phones: the longer copy still fits one screen. */
@media (max-width: 600px) {
  :root {
    --text: clamp(14.5px, min(4.75vw, 2.22svh), 24px);
  }
  .home__intro {
    gap: min(calc(var(--text) * 1.6), 3.2svh);
  }
  .home {
    padding-top: clamp(10px, 3.2svh, 40px);
    gap: clamp(12px, 2.6svh, 40px);
  }
}
