/* Quillory Limited
   Palette: paper, ink, royal (writing-ink blue), wash, marker */

:root {
  --paper: #EEF0F7;
  --ink: #1B1F4B;
  --royal: #3340D6;
  --wash: #DDE1F5;
  --marker: #F2E94E;
  --rule: rgba(27, 31, 75, 0.18);
  --rule-paper: rgba(238, 240, 247, 0.24);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --header-h: 4.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--marker);
  color: var(--ink);
}

h1,
h2,
h3,
p,
ul,
ol,
address {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

address {
  font-style: normal;
}

:focus-visible {
  outline: 3px solid var(--royal);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 0 0 6px 6px;
}

.skip-link:focus {
  top: 0;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(238, 240, 247, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--rule);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
}

.logo__mark {
  width: 1.9rem;
  height: 1.9rem;
  color: var(--royal);
}

.logo__word {
  font-size: 1.45rem;
  letter-spacing: -0.01em;
  line-height: 1;
}

.site-nav {
  display: flex;
  gap: 2.25rem;
  font-family: var(--sans);
  font-size: 0.95rem;
}

.site-nav a {
  position: relative;
  padding: 0.4rem 0;
  text-decoration: none;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--royal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.site-nav a:hover::after,
.site-nav a[aria-current="true"]::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  padding: 0.5rem 1rem;
  background: none;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.9rem;
  cursor: pointer;
}

/* Buttons */

.btn {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  background: var(--royal);
  border: 1.5px solid var(--royal);
  border-radius: 999px;
  color: #fff;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  background: var(--ink);
  border-color: var(--ink);
}

.btn--ghost {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.btn--ghost:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn--paper {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

.btn--paper:hover {
  background: var(--marker);
  border-color: var(--marker);
  color: var(--ink);
}

.btn--ghost-paper {
  background: transparent;
  border-color: var(--paper);
  color: var(--paper);
}

.btn--ghost-paper:hover {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

/* Hero */

.hero {
  padding-top: clamp(3.5rem, 10vw, 8rem);
  overflow: hidden;
}

.hero__title {
  max-width: 15ch;
  font-size: clamp(2.6rem, 7.4vw, 6.25rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.hero__lede {
  max-width: 34rem;
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  font-size: clamp(1.125rem, 1.6vw, 1.3rem);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.25rem;
}

.hero__line {
  display: block;
  width: 100%;
  height: auto;
  margin-top: clamp(1rem, 3vw, 2.5rem);
}

.hero__line path {
  fill: none;
  stroke: var(--royal);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 2.6s cubic-bezier(0.65, 0, 0.35, 1) 0.35s forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* Sections */

.section {
  padding-block: clamp(4rem, 9vw, 8rem);
}

.section--wash {
  background: var(--wash);
}

.section--ink {
  background: var(--ink);
  color: var(--paper);
}

.section__title {
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.section__intro {
  max-width: 20rem;
  margin-top: 1rem;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.split__aside {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
}

/* Services */

.service {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 1rem 2.5rem;
  padding-block: 1.75rem;
  border-top: 1px solid var(--rule);
}

.service:last-child {
  border-bottom: 1px solid var(--rule);
}

.service h3 {
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.service p {
  font-size: 1.05rem;
}

/* Steps */

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2.5rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  counter-reset: step;
}

.step {
  counter-increment: step;
  padding-top: 1.25rem;
  border-top: 2px solid var(--royal);
}

.step::before {
  content: counter(step);
  display: block;
  color: var(--royal);
  font-size: 3.5rem;
  line-height: 1;
}

.step h3 {
  margin-top: 1rem;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.25;
}

.step p {
  margin-top: 0.6rem;
  font-size: 1.05rem;
}

/* Contact */

.contact__lede {
  max-width: 36rem;
  font-size: clamp(1.15rem, 1.7vw, 1.35rem);
}

.contact__email {
  display: inline-block;
  margin-top: 2.5rem;
  color: var(--paper);
  font-size: clamp(1.6rem, 4.4vw, 3.25rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-decoration-color: var(--marker);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
  transition: color 0.2s ease;
}

.contact__email:hover {
  color: var(--marker);
}

.contact__address {
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule-paper);
  font-size: 1.2rem;
  line-height: 1.55;
}

.contact__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.25rem;
}

.contact__status {
  min-height: 1.6rem;
  margin-top: 1rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--marker);
}

.section--ink :focus-visible {
  outline-color: var(--marker);
}

/* Footer */

.site-footer {
  padding-block: 3rem;
  background: var(--ink);
  color: var(--paper);
  border-top: 1px solid var(--rule-paper);
  font-family: var(--sans);
  font-size: 0.9rem;
  line-height: 1.6;
}

.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 1.5rem 3rem;
}

.site-footer__legal {
  max-width: 34rem;
}

.site-footer__nav {
  display: flex;
  gap: 2rem;
  justify-content: flex-end;
}

.site-footer__nav a {
  text-underline-offset: 0.2em;
}

.site-footer__nav a:hover {
  color: var(--marker);
}

.site-footer__copy {
  grid-column: 1 / -1;
  opacity: 0.75;
}

.site-footer :focus-visible {
  outline-color: var(--marker);
}

/* Legal pages */

.legal {
  padding-block: clamp(3rem, 8vw, 6rem) clamp(4rem, 9vw, 7rem);
}

.legal__inner {
  max-width: 44rem;
}

.legal h1 {
  font-size: clamp(2.4rem, 6vw, 4.25rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.legal__updated {
  margin-top: 1rem;
  font-family: var(--sans);
  font-size: 0.95rem;
}

.legal h2 {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.legal p,
.legal ul,
.legal address {
  margin-top: 1rem;
}

.legal ul {
  padding-left: 1.3rem;
  list-style: disc;
}

.legal li + li {
  margin-top: 0.4rem;
}

.legal a {
  color: var(--royal);
  text-underline-offset: 0.2em;
}

.legal a:hover {
  color: var(--ink);
}

/* Smaller screens */

@media (max-width: 860px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }

  .split__aside {
    position: static;
  }

  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-footer__nav {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 1.0625rem;
  }

  .nav-toggle {
    display: inline-block;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.25rem;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    font-size: 1.1rem;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 0.85rem 0;
    border-top: 1px solid var(--rule);
  }

  .site-nav a::after {
    display: none;
  }

  .service {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
  }

  .steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }

  .hero__line path {
    stroke-width: 5;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero__line path {
    animation: none;
    stroke-dashoffset: 0;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}