/*
  AstroLink
  Paper #F4F4F7, ink #1A1530, indigo #2E11A6, magenta #B1398B, slate #5E5A72, rule #D9D7E3
  Onest for everything; Caveat only for the hand-written notes on the hero sketch.
*/

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("./assets/fonts/onest-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Caveat";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url("./assets/fonts/caveat-latin.woff2") format("woff2");
}

:root {
  --paper: #f4f4f7;
  --white: #ffffff;
  --ink: #1a1530;
  --indigo: #2e11a6;
  --magenta: #b1398b;
  --slate: #5e5a72;
  --rule: #d9d7e3;
  --sans: "Onest", "Segoe UI", system-ui, sans-serif;
  --hand: "Caveat", "Segoe Print", cursive;
  --max: 70rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
dl,
dd,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

a {
  color: var(--indigo);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 0.9rem;
  background: var(--ink);
  color: var(--white);
}

.skip:focus {
  top: 0.75rem;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
}

/* The wordmark file is white; render it in ink. */
.brand-wordmark {
  height: 1.75rem;
  width: auto;
  filter: brightness(0) saturate(100%) invert(8%) sepia(18%) saturate(2200%) hue-rotate(220deg);
}

.nav {
  display: flex;
  gap: clamp(0.75rem, 2.5vw, 2rem);
}

.nav a {
  font-size: 0.975rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}

.nav a:hover {
  color: var(--indigo);
  text-decoration: underline;
}

/* Hero */

.hero {
  padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(3rem, 7vw, 5rem);
}

.hero-grid {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.5rem, 5.4vw, 3.9rem);
  max-width: 14ch;
}

.lede {
  margin-top: 1.5rem;
  max-width: 34rem;
  font-size: 1.2rem;
  color: var(--slate);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 2.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.75rem 1.4rem;
  border-radius: 6px;
  font-weight: 500;
  color: var(--white);
  background: var(--indigo);
  text-decoration: none;
}

.btn:hover {
  background: var(--ink);
}

.text-link {
  font-weight: 500;
}

/* Hero sketch: the one-pager on a phone, with hand-written margin notes */

.sketch {
  --row-head: 5.4rem;
  --row-call: 4rem;
  --row-map: 10.5rem;
  --row-rev: 6rem;
  --row-foot: 4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17rem minmax(0, 1fr);
  grid-template-rows: var(--row-head) var(--row-call) var(--row-map) var(--row-rev) var(--row-foot) auto;
  column-gap: 0;
}

.phone {
  grid-column: 2;
  grid-row: 1 / 6;
  display: grid;
  grid-template-rows: subgrid;
  padding: 0 0.9rem;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 28px;
  overflow: hidden;
}

.phone > * {
  align-self: center;
}

.ph-head {
  display: grid;
  padding-top: 1.1rem;
}

.ph-name {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
}

.ph-sub {
  font-size: 0.8rem;
  color: var(--slate);
}

.ph-call span {
  display: block;
  padding: 0.6rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  color: var(--white);
  background: var(--magenta);
}

.ph-map {
  position: relative;
  height: 9.25rem;
  border-radius: 6px;
  background:
    linear-gradient(28deg, transparent 46%, var(--white) 46% 54%, transparent 54%),
    linear-gradient(-62deg, transparent 47%, var(--white) 47% 52%, transparent 52%),
    linear-gradient(90deg, transparent 70%, var(--white) 70% 73%, transparent 73%),
    #e3e1ec;
}

.ph-pin {
  position: absolute;
  left: 54%;
  top: 38%;
  width: 1rem;
  height: 1rem;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--indigo);
}

.ph-reviews,
.ph-foot {
  display: grid;
  gap: 0.4rem;
}

.ph-stars {
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: #c98a12;
}

.ph-line {
  display: block;
  height: 0.45rem;
  border-radius: 4px;
  background: var(--rule);
}

.ph-line.short {
  width: 60%;
}

.ph-foot {
  padding-top: 0.6rem;
  border-top: 1px solid var(--rule);
}

.ph-kvk {
  font-size: 0.72rem;
  color: var(--slate);
}

.note {
  position: relative;
  align-self: center;
  max-width: 12.5rem;
  font-family: var(--hand);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.05;
  color: var(--indigo);
}

/* Leader line from the note to the phone */
.note::after {
  content: "";
  position: absolute;
  top: 50%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transform-origin: var(--from, left);
  animation: draw 0.5s cubic-bezier(0.3, 0.7, 0.4, 1) backwards;
  animation-delay: calc(0.45s + var(--i) * 0.25s);
}

.n-call,
.n-reviews {
  grid-column: 1;
  justify-self: end;
  text-align: right;
  padding-right: 1.25rem;
}

.n-call::after,
.n-reviews::after {
  --from: right;
  right: -1.5rem;
  width: 2.5rem;
}

.n-map,
.n-foot {
  grid-column: 3;
  padding-left: 1.25rem;
}

.n-map::after,
.n-foot::after {
  left: -1.5rem;
  width: 2.5rem;
}

.n-call {
  --i: 0;
  grid-row: 2;
}

.n-map {
  --i: 1;
  grid-row: 3;
}

.n-reviews {
  --i: 2;
  grid-row: 4;
}

.n-foot {
  --i: 3;
  grid-row: 5;
}

.note {
  animation: appear 0.4s ease-out backwards;
  animation-delay: calc(0.75s + var(--i) * 0.25s);
}

@keyframes draw {
  from {
    transform: scaleX(0);
  }
}

@keyframes appear {
  from {
    opacity: 0;
  }
}

.sketch-cap {
  grid-column: 1 / -1;
  grid-row: 6;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  text-align: center;
  color: var(--slate);
}

/* Content blocks */

.block {
  padding: clamp(3.5rem, 8vw, 6rem) 0;
  border-top: 1px solid var(--rule);
}

.block h2 {
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  max-width: 20ch;
}

.intro {
  margin-top: 1rem;
  max-width: 32rem;
  font-size: 1.125rem;
  color: var(--slate);
}

.narrow p {
  margin-top: 1rem;
  max-width: 62ch;
}

/* Price */

.price-grid,
.contact-grid {
  display: grid;
  gap: 2.5rem;
}

.terms {
  display: grid;
  gap: 1.75rem;
}

.terms dt {
  font-weight: 700;
}

.terms dd {
  margin-top: 0.25rem;
  max-width: 46ch;
  color: var(--slate);
}

/* Steps: a real sequence, so it is numbered */

.steps {
  counter-reset: step;
  display: grid;
  gap: 2rem;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 3.25rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.1rem;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 2px solid var(--indigo);
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--indigo);
  background: var(--paper);
}

.steps h3 {
  font-size: 1.2rem;
  line-height: 1.6rem;
}

.steps p {
  margin-top: 0.4rem;
  max-width: 34ch;
  color: var(--slate);
}

/* Contact */

.mail {
  display: inline-block;
  margin-top: 1.75rem;
  font-size: clamp(1.5rem, 4.2vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.facts {
  display: grid;
  gap: 1.25rem;
  align-self: end;
}

.facts dt {
  font-size: 0.95rem;
  color: var(--slate);
}

.facts dd {
  font-weight: 500;
}

/* Footer */

.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
  color: var(--slate);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
}

.foot-mark {
  width: 2.25rem;
  height: 1.35rem;
  background: var(--indigo);
  -webkit-mask: url("./assets/mark.png") center / contain no-repeat;
  mask: url("./assets/mark.png") center / contain no-repeat;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-left: auto;
}

/* Breakpoints */

@media (min-width: 760px) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .price-grid,
  .contact-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
}

@media (min-width: 1000px) {
  .hero-grid {
    grid-template-columns: 1fr 1.2fr;
  }

  /* One line of steps joined by a rule, read left to right */
  .steps {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }

  .steps li {
    padding-left: 0;
    padding-top: 3.25rem;
  }

  .steps li::after {
    content: "";
    position: absolute;
    top: 1.05rem;
    left: 2.6rem;
    right: -1.5rem;
    height: 2px;
    background: var(--rule);
  }

  .steps li:last-child::after {
    display: none;
  }
}

/* Phone and notes side by side on small screens: all notes on the right */
@media (max-width: 620px) {
  .sketch {
    --row-head: 4.2rem;
    --row-call: 3.3rem;
    --row-map: 7rem;
    --row-rev: 5rem;
    --row-foot: 3.6rem;
    grid-template-columns: 11.5rem minmax(0, 1fr);
  }

  .phone {
    grid-column: 1;
    padding: 0 0.7rem;
    border-radius: 22px;
  }

  .ph-map {
    height: 6rem;
  }

  .ph-name {
    font-size: 0.9rem;
  }

  .n-call,
  .n-reviews,
  .n-map,
  .n-foot {
    grid-column: 2;
    justify-self: start;
    text-align: left;
    padding: 0 0 0 1.4rem;
    font-size: 1.2rem;
  }

  .n-call::after,
  .n-reviews::after,
  .n-map::after,
  .n-foot::after {
    --from: left;
    left: -0.6rem;
    right: auto;
    width: 1.6rem;
  }

  .sketch-cap {
    text-align: left;
  }

  .nav a:not([href="#contact"]) {
    display: none;
  }

  .foot-links {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .note,
  .note::after {
    animation: none;
  }
}

/* Text pages (privacy, 404) */

.page h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
}

.page h2 {
  margin-top: 2.5rem;
  font-size: 1.4rem;
  max-width: none;
}
