@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("/fonts/instrument-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("/fonts/instrument-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Palette: navy ink on cool paper, Barcelona-taxi yellow for the block mark. */
:root {
  --paper: #f5f7fa;
  --ink: #13223f;
  --ink-soft: #46546d;
  --block: #e3e9f2;
  --map: #dce3ed;
  --line: #c9d3e1;
  --yellow: #f2c230;
  --on-yellow: #13223f;
  --link: #1d3fb8;

  --font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 36rem;
  --page: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --street: 14px;
  --chamfer: 22px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1b30;
    --ink: #e8edf5;
    --ink-soft: #a8b4c8;
    --block: #1a2a45;
    --map: #1c2d4b;
    --line: #2b3d5c;
    --link: #9db4ff;
  }
}

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

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

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

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

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

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

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* The Eixample block: a square with cut corners. Used for the plan grid and the button. */
.chamfer,
.button::before {
  clip-path: polygon(
    var(--chamfer) 0,
    calc(100% - var(--chamfer)) 0,
    100% var(--chamfer),
    100% calc(100% - var(--chamfer)),
    calc(100% - var(--chamfer)) 100%,
    var(--chamfer) 100%,
    0 calc(100% - var(--chamfer)),
    0 var(--chamfer)
  );
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  font-stretch: 85%;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 1.75rem;
  height: 1.75rem;
}

.brand-block {
  fill: var(--yellow);
}

.brand-c {
  fill: none;
  stroke: var(--on-yellow);
  stroke-width: 4.5;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 550;
}

.site-nav a:hover {
  text-decoration: underline;
}

/* Hero */
.hero {
  padding-top: clamp(2.5rem, 8vw, 6rem);
  padding-bottom: clamp(2.5rem, 6vw, 5rem);
}

.hero h1 {
  margin: 0;
  max-width: 11ch;
  font-size: clamp(3rem, 8.4vw, 6.25rem);
  line-height: 0.94;
  font-weight: 640;
  font-stretch: 75%;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.hero p {
  margin: 1.75rem 0 0;
  max-width: 30rem;
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  line-height: 1.5;
  color: var(--ink-soft);
}

.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}

/* A piece of the Eixample around Gran Via, with our block in yellow. */
.hero-map {
  margin: 0;
}

.map {
  display: block;
  width: 100%;
  height: auto;
  -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent);
  mask-image: radial-gradient(closest-side, #000 72%, transparent);
}

.map-block {
  fill: var(--map);
}

.map-avenue {
  fill: none;
  stroke: var(--paper);
  stroke-width: 50;
}

.map-home {
  fill: var(--yellow);
}

.map-block,
.map-home {
  transform-box: fill-box;
  transform-origin: center;
}

/* The one moment of motion: the city grows outward from our block. */
@media (prefers-reduced-motion: no-preference) {
  .map-home {
    animation: home-in 650ms cubic-bezier(0.3, 1.45, 0.5, 1) both;
  }

  .map-block {
    animation: block-in 480ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
    animation-delay: calc(150ms + var(--d) * 75ms);
  }
}

@keyframes home-in {
  from {
    opacity: 0;
    transform: scale(0.3);
  }
}

@keyframes block-in {
  from {
    opacity: 0;
    transform: scale(0.55);
  }
}

.button {
  --chamfer: 9px;
  position: relative;
  isolation: isolate;
  display: inline-block;
  margin-top: 2.25rem;
  padding: 0.9rem 1.45rem;
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
}

.button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ink);
  transition: background-color 150ms ease;
}

.button:hover::before {
  background: color-mix(in srgb, var(--ink) 84%, var(--yellow));
}

@media (max-width: 860px) {
  .hero-split {
    grid-template-columns: 1fr;
  }

  .hero-map {
    max-width: 34rem;
  }
}

/* Sections: heading in a narrow left column, content on the right. */
.section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  align-items: baseline;
  gap: 0 clamp(2rem, 5vw, 4.5rem);
  padding-top: clamp(2.5rem, 5vw, 4rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.1;
  font-weight: 620;
  font-stretch: 80%;
  letter-spacing: -0.015em;
}

.section p {
  margin: 0 0 1rem;
  max-width: var(--measure);
}

.section .lead {
  max-width: 32rem;
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  line-height: 1.35;
  font-weight: 520;
  letter-spacing: -0.01em;
}

@media (max-width: 760px) {
  .section {
    grid-template-columns: 1fr;
  }

  .section h2 {
    margin-bottom: 1.5rem;
  }
}

/* The plan: four blocks separated by streets, like a piece of the Eixample map. */
.section:has(.plan) {
  align-items: start;
}

.plan {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--street);
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan li {
  min-height: 15rem;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  background: var(--block);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.plan h3 {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
  line-height: 1.2;
  font-weight: 620;
  font-stretch: 85%;
}

.section .plan p {
  margin: 0;
  color: var(--ink-soft);
}

@media (max-width: 640px) {
  .plan {
    grid-template-columns: 1fr;
  }

  .plan li {
    min-height: 0;
    padding-top: 2.75rem;
  }
}

/* Contact */
.contact-email {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: clamp(1.9rem, 6vw, 3.75rem);
  line-height: 1.1;
  font-weight: 620;
  font-stretch: 78%;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration-color: var(--yellow);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.14em;
  overflow-wrap: anywhere;
}

.contact-email:hover {
  text-decoration-thickness: 0.14em;
}

/* Footer */
.site-footer {
  margin-top: clamp(2rem, 6vw, 4rem);
  padding-bottom: 2.5rem;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

/* The rule sits inside the padding so it lines up with the text. */
.site-footer::before {
  content: "";
  display: block;
  margin-bottom: 1.75rem;
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0 0 0.4rem;
}

.site-footer a {
  color: var(--ink-soft);
}

/* Legal page */
.legal {
  padding-top: clamp(2rem, 6vw, 4rem);
  padding-bottom: 2rem;
}

.legal h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.25rem, 5.5vw, 3.5rem);
  line-height: 1;
  font-weight: 640;
  font-stretch: 75%;
  letter-spacing: -0.02em;
}

.legal h2 {
  margin: 2.75rem 0 0.75rem;
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 620;
  font-stretch: 85%;
}

.legal h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 620;
}

.legal p,
.legal ul,
.legal dl {
  max-width: 42rem;
}

.legal ul {
  padding-left: 1.25rem;
}

.legal li {
  margin-bottom: 0.35rem;
}

.legal dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1.5rem;
  margin: 1.25rem 0;
}

.legal dt {
  font-weight: 600;
}

.legal dd {
  margin: 0;
}

.legal .lang-switch {
  color: var(--ink-soft);
}

.legal hr {
  margin: 3.5rem 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  max-width: 42rem;
}

@media (max-width: 520px) {
  .legal dl {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .legal dd {
    margin-bottom: 0.6rem;
  }
}
