:root {
  --blue: #0247fb;
  --blue-deep: #0132b8;
  --paper: #f7f3ea;
  --paper-tint: #efe9db;
  --ink: #17150f;
  --ink-soft: #4a463b;
  --muted: #7d7767;
  --line: #d8d1bf;
  --line-soft: #e4ded0;
  --dark: #14120c;
  --display: "Fraunces", "Georgia", serif;
  --body: "Newsreader", "Georgia", serif;
  --mono: "Spline Sans Mono", "Courier New", monospace;
  --max: 72rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink-soft);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.05'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection {
  background: var(--blue);
  color: #fff;
}

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

h1,
h2,
h3 {
  font-family: var(--display);
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.08;
  margin: 0;
  font-weight: 420;
}

h1 em,
h2 em {
  font-style: italic;
  font-weight: 340;
  color: var(--blue);
}

a {
  color: var(--blue);
  text-decoration: none;
}

.shell {
  width: min(100% - 3rem, var(--max));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.75rem 1rem;
  background: var(--blue);
  color: #fff;
  z-index: 1000;
}
.skip:focus {
  left: 0;
  top: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  padding: 0.9rem 1.6rem;
  border: 1px solid var(--ink);
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn span {
  transition: transform 0.25s var(--ease);
}
.btn:hover span {
  transform: translate(2px, -2px);
}
.btn--primary {
  background: var(--ink);
  color: var(--paper);
}
.btn--primary:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.btn--quiet {
  color: var(--ink);
  border-color: var(--line);
}
.btn--quiet:hover {
  border-color: var(--ink);
}
.btn--light {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}
.btn--light:hover {
  background: transparent;
  color: var(--paper);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 243, 234, 0.88);
  backdrop-filter: saturate(140%) blur(10px);
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.1rem;
}
.logo img {
  width: 128px;
  height: auto;
}
.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav a {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.2s;
}
.nav a:hover {
  color: var(--blue);
}
.nav__cta {
  padding: 0.45rem 1rem;
  border: 1px solid var(--ink);
  color: var(--ink) !important;
}
.nav__cta:hover {
  background: var(--ink);
  color: var(--paper) !important;
}
@media (max-width: 40rem) {
  .nav a:not(.nav__cta) {
    display: none;
  }
}

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(3.5rem, 8vw, 6.5rem) 0;
}
.hero__inner {
  display: grid;
  gap: 3rem;
  align-items: center;
}
@media (min-width: 56rem) {
  .hero__inner {
    grid-template-columns: 1.35fr 0.65fr;
    gap: 4rem;
  }
}
.hero__def {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  display: inline-block;
  padding-bottom: 0.6rem;
  margin: 0 0 2rem;
}
.hero__def strong {
  color: var(--ink);
  font-weight: 500;
}
.hero__def em {
  font-style: italic;
}
.hero__title {
  font-size: clamp(2.6rem, 7vw, 5rem);
  max-width: 14ch;
}
.hero__lead {
  margin: 1.75rem 0 0;
  max-width: 44ch;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-soft);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2.5rem;
}

.hero__mark {
  color: var(--blue);
  justify-self: center;
  text-align: center;
  max-width: 260px;
}
@media (max-width: 55.99rem) {
  .hero__mark {
    display: none;
  }
}
.sunmark {
  width: 100%;
  height: auto;
  display: block;
}
.sunmark__spin {
  transform-origin: 100px 100px;
  animation: deasil-turn 80s linear infinite;
}
@keyframes deasil-turn {
  to {
    transform: rotate(360deg);
  }
}
.hero__mark-caption {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 1.25rem 0 0;
}
.hero__mark-caption em {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.5em;
  letter-spacing: 0;
  color: var(--ink);
}

/* Stats */
.stats {
  display: grid;
  gap: 0;
  margin: clamp(3rem, 7vw, 5rem) 0 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 44rem) {
  .stats {
    grid-template-columns: repeat(3, 1fr);
  }
}
.stat {
  padding: 1.5rem 0;
}
@media (min-width: 44rem) {
  .stat + .stat {
    border-left: 1px solid var(--line);
    padding-left: 2rem;
  }
}
@media (max-width: 43.99rem) {
  .stat + .stat {
    border-top: 1px solid var(--line);
  }
}
.stat__label {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 0.5rem;
}
.stat__num {
  font-family: var(--display);
  font-weight: 420;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  color: var(--ink);
  line-height: 1.05;
  margin: 0;
}
.stat__num span {
  color: var(--blue);
}
.stat__num--word {
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  font-style: italic;
  font-weight: 340;
  max-width: 16ch;
}

/* ---------- Pillars (ledger rows) ---------- */
.pillars-section {
  padding-block: clamp(3rem, 7vw, 5.5rem) clamp(1.5rem, 4vw, 2.5rem);
}
.pillars {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pillar {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 0.35rem 1.5rem;
  align-items: baseline;
  padding: 1.6rem 0.5rem;
  border-bottom: 1px solid var(--line);
  transition: background 0.3s var(--ease), padding-left 0.3s var(--ease);
}
.pillar:first-child {
  border-top: 1px solid var(--ink);
}
@media (min-width: 48rem) {
  .pillar {
    grid-template-columns: 5rem 16rem 1fr;
  }
}
.pillar:hover {
  background: var(--paper-tint);
  padding-left: 1rem;
}
.pillar__index {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--blue);
}
.pillar__label {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 420;
}
.pillar__text {
  margin: 0;
  grid-column: 2;
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 52ch;
}
@media (min-width: 48rem) {
  .pillar__text {
    grid-column: 3;
  }
}

/* ---------- Sections ---------- */
.section {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
}
.section--tint {
  background: var(--paper-tint);
}
.section__rule {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  border-top: 1px solid var(--ink);
  padding-top: 0.75rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  font-family: var(--mono);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.section__name {
  color: var(--ink);
}
.section__grid {
  display: grid;
  gap: 2.5rem;
}
@media (min-width: 52rem) {
  .section__grid {
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: start;
  }
}
.section__title {
  font-size: clamp(1.8rem, 3.8vw, 2.8rem);
  max-width: 20ch;
  margin-bottom: 1.5rem;
}
.section__body p {
  margin: 0 0 2rem;
  font-size: 1.125rem;
}
.section__body p::first-letter {
  font-family: var(--display);
  font-weight: 420;
  font-size: 3.1em;
  float: left;
  line-height: 0.82;
  padding: 0.08em 0.12em 0 0;
  color: var(--ink);
}

/* Index list with dot leaders */
.index-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.index-list li {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--ink);
  transition: padding-left 0.3s var(--ease);
}
.index-list li:first-child {
  border-top: 1px solid var(--line);
}
.index-list li:hover {
  padding-left: 0.6rem;
}
.index-list li:hover .index-list__no {
  color: var(--blue);
}
.index-list li::after {
  content: "";
  order: 2;
  flex: 1;
  border-bottom: 1px dotted var(--line);
  transform: translateY(-0.25em);
}
.index-list__item {
  order: 1;
}
.index-list__no {
  order: 3;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
  transition: color 0.3s;
}

/* ---------- Cases (clients) ---------- */
.cases {
  display: grid;
  gap: 2rem;
  margin-top: clamp(2rem, 5vw, 3rem);
}
@media (min-width: 48rem) {
  .cases {
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
  }
  .case + .case {
    border-left: 1px solid var(--line);
    padding-left: 2.25rem;
  }
  .case {
    padding-right: 2.25rem;
  }
}
.case__tag {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--blue);
  margin: 0 0 1rem;
}
.case__title {
  font-size: 1.45rem;
  font-weight: 420;
  margin-bottom: 0.75rem;
}
.case__text {
  margin: 0;
  font-size: 1.05rem;
  color: var(--muted);
}

/* ---------- Testimonial ---------- */
.testimonial {
  display: grid;
  gap: 2.5rem;
  align-items: center;
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
}
@media (min-width: 48rem) {
  .testimonial {
    grid-template-columns: auto 1fr;
    gap: 3.5rem;
  }
}
.testimonial__media {
  margin: 0;
  width: 200px;
  text-align: center;
}
.testimonial__media img {
  width: 180px;
  height: 180px;
  margin-inline: auto;
  object-fit: cover;
  border-radius: 50%;
  filter: grayscale(100%) contrast(1.05);
  border: 1px solid var(--line);
  outline: 1px dashed var(--line);
  outline-offset: 10px;
}
.testimonial__media figcaption {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-top: 1.5rem;
}
.testimonial__body {
  max-width: 46rem;
}
.testimonial .quote {
  margin: 0;
}
.affiliation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: 2rem 0 0;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.affiliation__label {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.affiliation__link {
  display: block;
  transition: opacity 0.25s var(--ease);
}
.affiliation__link:hover {
  opacity: 0.6;
}
.affiliation__link img {
  width: 104px;
  height: auto;
}

.quote {
  margin: 2.25rem 0 0;
  padding: 0 0 0 1.75rem;
  border-left: 2px solid var(--blue);
}
.quote__text {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  font-weight: 340;
  font-style: italic;
  color: var(--ink);
  line-height: 1.4;
}
.quote__text::before {
  content: "\201C";
  color: var(--blue);
}
.quote__text::after {
  content: "\201D";
  color: var(--blue);
}
.quote__cite {
  display: block;
  margin-top: 1.25rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-style: normal;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}
.quote__cite span {
  display: block;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* ---------- Contact ---------- */
.contact {
  position: relative;
  padding-block: clamp(4.5rem, 10vw, 8rem);
  background: var(--dark);
  color: #cfc9b8;
  overflow: hidden;
  border-top: 3px solid var(--blue);
}
.contact__mark {
  position: absolute;
  top: 50%;
  right: -8%;
  width: clamp(320px, 40vw, 620px);
  transform: translateY(-50%);
  color: rgba(247, 243, 234, 0.08);
}
.contact__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.contact__logo {
  width: 140px;
  margin-bottom: 2.5rem;
}
.contact__title {
  color: var(--paper);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 420;
  max-width: 18ch;
}
.contact__title em {
  color: #7d9bff;
}
.contact__text {
  margin: 1.5rem 0 2.5rem;
  font-size: 1.15rem;
  color: rgba(207, 201, 184, 0.85);
  max-width: 42ch;
}

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 1.75rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  align-items: center;
  justify-content: space-between;
}
.site-footer__def {
  font-style: italic;
}
.site-footer a {
  color: var(--ink-soft);
}
.site-footer a:hover {
  color: var(--blue);
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--d, 0ms);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .sunmark__spin {
    animation: none;
  }
}
