/* Maraya — site institucional. Tokens first; components below in page order. */

:root {
  /* Navy and teal come from the logo. Teal fills buttons and shapes; teal-ink is the teal dark enough for text. */
  --paper: #f8fafb;
  --white: #ffffff;
  --ink: #042a41;
  --text: #1f3445;
  --muted: #546576;
  --teal: #26b2b0;
  --teal-ink: #0f716d;
  --mist: #e8f1f3;
  --line: #d3dee4;
  --night-text: #c8d6df;
  --night-muted: #93a9b8;
  --pending: #ffe58a;

  --serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(72px, 11vw, 152px);
  --maxw: 1200px;
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

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

@media (min-width: 900px) {
  body {
    font-size: 1.125rem;
  }
}

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

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

a {
  color: inherit;
}

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

.container {
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--gutter);
  z-index: 10;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--white);
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

mark.pending {
  padding: 0 0.3em;
  border-radius: 2px;
  background: var(--pending);
  color: var(--ink);
}

/* Buttons and links. On hover the button fills with navy from the left and lifts a little; links draw a teal
   underline. */

.button {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 16px 24px;
  border-radius: 2px;
  background: var(--teal);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: color 0.3s ease, transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease;
}

.button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}

.button:hover,
.button:focus-visible {
  color: var(--white);
}

.button:hover::before,
.button:focus-visible::before {
  transform: scaleX(1);
  transform-origin: left center;
}

@media (prefers-reduced-motion: no-preference) {
  .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -14px rgba(4, 42, 65, 0.6);
  }

  .button:active {
    transform: translateY(0) scale(0.98);
  }
}

.button--small {
  padding: 11px 16px;
  font-size: 0.875rem;
}

.text-link {
  padding-bottom: 3px;
  background:
    linear-gradient(var(--teal), var(--teal)) left bottom / 0 2px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 100% 1px no-repeat;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: background-size 0.4s cubic-bezier(0.65, 0, 0.35, 1), color 0.2s ease;
}

.text-link:hover {
  background-size: 100% 2px, 100% 1px;
  color: var(--teal-ink);
}

/* Header */

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
  padding-block: 20px;
}

.brand img {
  width: auto;
  height: 30px;
}

@media (min-width: 720px) {
  .brand img {
    height: 40px;
  }
}

.site-nav {
  margin-left: auto;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  padding-bottom: 4px;
  background: linear-gradient(var(--teal), var(--teal)) left bottom / 0 2px no-repeat;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: background-size 0.35s cubic-bezier(0.65, 0, 0.35, 1), color 0.2s ease;
}

.site-nav a:hover {
  background-size: 100% 2px;
  color: var(--teal-ink);
}

@media (max-width: 719px) {
  .site-header .button--small {
    margin-left: auto;
  }

  .site-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
  }
}

/* Hero */

.hero {
  padding-block: clamp(40px, 7vw, 104px) clamp(64px, 9vw, 120px);
}

.hero h1 {
  max-width: 21ch;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(2.5rem, 6.2vw, 5.5rem);
  font-weight: 500;
  line-height: 1.03;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.hero__body {
  display: grid;
  gap: 28px;
  margin-top: clamp(24px, 3vw, 40px);
}

.hero__lead {
  max-width: 36rem;
  font-size: clamp(1.0625rem, 1.35vw, 1.25rem);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
}

@media (min-width: 900px) {
  .hero__body {
    grid-template-columns: minmax(0, 36rem) auto;
    align-items: end;
    gap: 56px;
  }
}

/* The one page-load moment: the headline rises, then the lead and the buttons follow. */
@media (prefers-reduced-motion: no-preference) {
  .hero h1,
  .hero__lead,
  .hero .actions {
    animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .hero__lead {
    animation-delay: 0.12s;
  }

  .hero .actions {
    animation-delay: 0.24s;
  }
}

/* The formats, side by side at the same pixel scale on one baseline */

.formats {
  margin-top: clamp(40px, 5vw, 72px);
}

.formats__list {
  display: grid;
  grid-template-columns: 1080fr 1080fr 1080fr 1440fr;
  align-items: end;
  gap: clamp(8px, 2.2vw, 28px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.format a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: inherit;
  text-decoration: none;
}

.format a:focus-visible {
  outline-offset: 6px;
}

.format__frame {
  position: relative;
  display: block;
  overflow: hidden;
  margin-bottom: 12px;
  container-type: inline-size;
}

.format--post .format__frame {
  aspect-ratio: 1 / 1;
  background: var(--mist);
  color: var(--ink);
}

.format--carousel .format__frame {
  aspect-ratio: 4 / 5;
  background: var(--teal);
  color: var(--ink);
}

.format--story .format__frame {
  aspect-ratio: 9 / 16;
  /* Phone-like corners: 7% of the width, the same length on the 16:9 height. */
  border-radius: 7% / 3.94%;
  background: var(--ink);
  color: var(--white);
}

.format--page .format__frame {
  aspect-ratio: 16 / 10;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
}

.format__ratio {
  position: absolute;
  bottom: 6cqw;
  left: 7cqw;
  font-family: var(--serif);
  font-size: 30cqw;
  font-variation-settings: "opsz" 18;
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.02em;
}

.format--page .format__ratio {
  bottom: 5cqw;
  left: 5cqw;
  font-size: 20cqw;
}

.format__count {
  position: absolute;
  top: 5cqw;
  right: 5cqw;
  padding: 1.5cqw 3.5cqw;
  border-radius: 999px;
  background: rgba(4, 42, 65, 0.55);
  color: var(--white);
  font-size: 7cqw;
  font-weight: 600;
  line-height: 1;
}

.format__bars {
  position: absolute;
  top: 6cqw;
  right: 6cqw;
  left: 6cqw;
  display: flex;
  gap: 2cqw;
}

.format__bars i {
  flex: 1;
  height: max(2px, 1.4cqw);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
}

.format__bars i:first-child {
  background: var(--white);
}

.format__bar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  height: 10cqw;
  padding-inline: 3cqw;
  background: var(--mist);
}

.format__address {
  padding: 1cqw 3cqw;
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  font-size: 3.6cqw;
  line-height: 1;
}

.format__name {
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
}

.format__size {
  color: var(--muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.format a:hover .format__name {
  color: var(--teal-ink);
}

.formats figcaption {
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.875rem;
}

@media (max-width: 599px) {
  .format__name {
    font-size: 0.75rem;
  }

  .format__size {
    font-size: 0.6875rem;
  }
}

/* The formats rise one after the other when the band scrolls into view (motion.js); each lifts on hover. */
@media (prefers-reduced-motion: no-preference) {
  .format__frame {
    transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  .format a:hover .format__frame {
    transform: translateY(-8px);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(32px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Sections */

.section {
  padding-block: var(--section);
}

.section h2 {
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(2.25rem, 4.6vw, 3.5rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

/* How it works: a real sequence, so the steps are numbered */

.steps {
  background: var(--mist);
}

.steps__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 40px 32px;
  margin: clamp(32px, 5vw, 64px) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps__list li {
  counter-increment: step;
}

.steps__list li::before {
  content: counter(step);
  display: block;
  margin-bottom: 16px;
  color: var(--teal-ink);
  font-family: var(--serif);
  font-size: clamp(3rem, 5vw, 4.5rem);
  /* A lower optical size keeps the hairlines of the 1 visible at display size. */
  font-variation-settings: "opsz" 18;
  line-height: 1;
}

.steps__list h3 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.3;
}

.steps__list p {
  max-width: 34ch;
  font-size: 1rem;
}

/* Services: six lines of work, each one available alone or in a package */

.pillars {
  padding-top: 0;
}

.pillars__intro {
  display: grid;
  gap: 20px;
  max-width: 60ch;
  margin-bottom: clamp(40px, 6vw, 72px);
}

.pillars__list {
  display: grid;
  gap: 0 48px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pillars__list li {
  position: relative;
  padding-block: 28px 36px;
  border-top: 1px solid var(--line);
}

/* On hover, a teal line runs along the service's top rule. */
.pillars__list li::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

.pillars__list li:hover::before {
  transform: scaleX(1);
}

.pillars__list h3 {
  margin-bottom: 10px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.75rem, 2.4vw, 2.125rem);
  font-weight: 500;
  line-height: 1.1;
}

.pillars__list p {
  max-width: 44ch;
  color: var(--muted);
  font-size: 1rem;
}

.pillars__list .text-link {
  margin-left: 4px;
  font-size: 0.9375rem;
}

@media (min-width: 640px) {
  .pillars__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .pillars__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Formats band */

.formats-band__lead {
  max-width: 46ch;
  margin-top: 16px;
}

/* About */

.about {
  padding-top: 0;
}

.about__inner {
  display: grid;
  gap: 24px 48px;
  padding-top: clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--line);
}

.about__text {
  display: grid;
  gap: 28px;
  max-width: 62ch;
}

.about__statement {
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.15;
}

@media (min-width: 900px) {
  .about__inner {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  }
}

/* Contact */

.contact {
  background: var(--ink);
  color: var(--night-text);
}

.contact h2 {
  color: var(--white);
}

.contact__inner {
  display: grid;
  gap: 48px;
}

.contact__inner p {
  max-width: 46ch;
  margin: 16px 0 32px;
}

.contact :focus-visible {
  outline-color: var(--white);
}

.contact .button::before {
  background: var(--white);
}

.contact .button:hover,
.contact .button:focus-visible {
  color: var(--ink);
}

.contact__list {
  display: grid;
  gap: 20px;
}

.contact__list dt {
  color: var(--night-muted);
  font-size: 0.875rem;
}

.contact__list dd {
  margin-top: 2px;
  color: var(--white);
  font-size: 1.125rem;
}

.contact__list a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.contact__list a:hover {
  color: var(--teal);
}

@media (min-width: 900px) {
  .contact__inner {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: end;
  }
}

/* Footer: light, so the logo (made for light backgrounds) sits on it */

.site-footer {
  padding-block: 48px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: 0.9375rem;
}

.site-footer__inner {
  display: grid;
  gap: 24px;
}

.site-footer__logo {
  width: auto;
  height: 36px;
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.site-footer a {
  padding-bottom: 4px;
  background: linear-gradient(var(--teal), var(--teal)) left bottom / 0 2px no-repeat;
  color: var(--ink);
  text-decoration: none;
  transition: background-size 0.35s cubic-bezier(0.65, 0, 0.35, 1), color 0.2s ease;
}

.site-footer a:hover {
  background-size: 100% 2px;
  color: var(--teal-ink);
}

.site-footer__copy {
  color: var(--muted);
}

@media (min-width: 900px) {
  .site-footer__inner {
    grid-template-columns: auto 1fr auto auto;
    align-items: end;
    gap: 48px;
  }
}

/* Legal pages (privacy) and the 404 page */

.legal {
  padding-block: clamp(48px, 8vw, 104px) var(--section);
}

.legal h1,
.notfound h1 {
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 500;
  line-height: 1.05;
}

.legal__updated {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.legal__body {
  max-width: 68ch;
  margin-top: clamp(32px, 5vw, 56px);
}

.legal__body h2 {
  margin: 40px 0 12px;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.legal__body p + p,
.legal__body p + ul,
.legal__body ul + p {
  margin-top: 12px;
}

.legal__body ul {
  margin-bottom: 0;
  padding-left: 1.2em;
}

.legal__body li + li {
  margin-top: 6px;
}

.notfound {
  padding-block: clamp(72px, 12vw, 160px);
}

.notfound p {
  max-width: 46ch;
  margin: 16px 0 32px;
}

/* Motion. motion.js marks the blocks below the fold as pending and brings each one in as it scrolls into view. */

@media (prefers-reduced-motion: no-preference) {
  .is-pending {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button,
  .button::before,
  .text-link,
  .site-nav a,
  .site-footer a,
  .pillars__list li::before {
    transition: none;
  }
}

@media print {
  .is-pending {
    opacity: 1;
  }
}
