:root {
  color-scheme: light;
  --ink: rgba(255, 255, 255, .96);
  --muted: rgba(255, 255, 255, .72);
  --line: rgba(255, 255, 255, .40);
  --line-dark: rgba(16, 18, 22, .08);
  --glass: rgba(255, 255, 255, .055);
  --glass-strong: rgba(255, 255, 255, .09);
  --radius: 22px;
  --radius-small: 10px;
  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --max: 1120px;
  --shadow: 0 22px 70px rgba(21, 31, 48, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #f7f7f5;
  font-family: var(--font-body);
  font-weight: 300;
  letter-spacing: -.012em;
  line-height: 1.55;
  overflow-x: hidden;
}
body.modal-open { overflow: hidden; }
button, a { color: inherit; }
button { border: 0; padding: 0; background: none; font: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

#flight-map {
  --flight-x: 0px;
  --flight-y: 0px;
  --flight-scale: 3.05;
  position: fixed;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  pointer-events: none;
  background: #d8d4c9;
}
.flight-image {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100vw, 147.64vh);
  height: auto;
  max-width: none;
  object-fit: contain;
  transform: translate3d(calc(-50% + var(--flight-x)), calc(-50% + var(--flight-y)), 0) scale(var(--flight-scale));
  transform-origin: center center;
  filter: saturate(1.04) brightness(.97) contrast(1.05);
  will-change: transform;
  user-select: none;
}
.flight-image--low {
  opacity: 1;
}
.flight-image--high {
  opacity: 0;
  transition: opacity 1.1s ease;
}
#flight-map.is-high-ready .flight-image--high {
  opacity: 1;
}
.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: #f7f7f5;
  color: rgba(255,255,255,.74);
  font-size: .86rem;
  letter-spacing: .02em;
  transition: opacity .45s ease, visibility .45s ease;
}
.preloader span::after {
  content: "";
  display: inline-block;
  width: 1.2em;
  animation: dots 1.2s steps(4, end) infinite;
}
@keyframes dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75%, 100% { content: "..."; }
}
body.is-loading main,
body.is-loading dialog {
  opacity: 0;
}
body:not(.is-loading) .preloader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.map-veil {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 8%, rgba(255,255,255,.028), transparent 31rem),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.025), transparent 30rem),
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012) 44%, rgba(255,255,255,.035));
}

.liquid-pill {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255,255,255,.145), rgba(255,255,255,.035) 48%, rgba(255,255,255,.075)),
    rgba(255,255,255,.045);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.42),
    inset 0 -1px 0 rgba(255,255,255,.08),
    0 22px 70px rgba(10,18,32,.10);
  backdrop-filter: blur(10px) brightness(1.015);
  -webkit-backdrop-filter: blur(10px) brightness(1.015);
  transform: translate3d(0, var(--reveal-y, 0px), 0);
  transition: transform .45s cubic-bezier(.2,.8,.2,1), background .45s ease, border-color .45s ease, box-shadow .45s ease, backdrop-filter .45s ease;
}
.liquid-pill::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255,255,255,.34), rgba(255,255,255,.06) 22%, transparent 52%),
    linear-gradient(315deg, transparent 58%, rgba(255,255,255,.16));
  opacity: .55;
}
.liquid-pill::after {
  content: "";
  position: absolute;
  inset: 1px;
  pointer-events: none;
  border-radius: calc(var(--radius) - 1px);
  background:
    linear-gradient(180deg, rgba(255,255,255,.15), transparent 18%, transparent 82%, rgba(255,255,255,.07));
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,.22),
    inset -1px -1px 0 rgba(255,255,255,.07);
  opacity: .72;
}
.liquid-pill > * { position: relative; z-index: 1; }
.liquid-pill:hover, .liquid-pill:focus-within {
  border-color: rgba(255,255,255,.36);
  background:
    linear-gradient(145deg, rgba(255,255,255,.16), rgba(255,255,255,.04) 48%, rgba(255,255,255,.08)),
    rgba(255,255,255,.05);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.48),
    inset 0 -1px 0 rgba(255,255,255,.09),
    0 26px 82px rgba(10,18,32,.12);
  backdrop-filter: blur(9px) brightness(1.015);
  -webkit-backdrop-filter: blur(9px) brightness(1.015);
}
.liquid-pill:hover::before, .liquid-pill:focus-within::before { opacity: .62; }


.section {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: 92px 0;
}
.section-pill {
  padding: clamp(26px, 4vw, 48px);
}
.section-pill > h2 {
  margin-bottom: clamp(24px, 4vw, 44px);
}
.hero {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding-top: 56px;
  padding-bottom: 56px;
}
.hero__panel {
  width: min(78vw, 560px);
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  padding: clamp(30px, 5vw, 58px);
  border-radius: var(--radius);
}
.hero__panel.liquid-pill {
  background:
    linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.018) 52%, rgba(255,255,255,.045)),
    rgba(255,255,255,.018);
  border-color: rgba(255,255,255,.22);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.34),
    inset 0 -1px 0 rgba(255,255,255,.045),
    0 24px 80px rgba(10,18,32,.09);
  backdrop-filter: blur(6px) brightness(1.006);
  -webkit-backdrop-filter: blur(6px) brightness(1.006);
}
.hero__panel.liquid-pill::before { opacity: .38; }
.hero__panel.liquid-pill::after { opacity: .44; }
.hero__panel.liquid-pill:hover,
.hero__panel.liquid-pill:focus-within {
  border-color: rgba(255,255,255,.28);
  background:
    linear-gradient(145deg, rgba(255,255,255,.105), rgba(255,255,255,.02) 52%, rgba(255,255,255,.05)),
    rgba(255,255,255,.022);
  backdrop-filter: blur(6px) brightness(1.006);
  -webkit-backdrop-filter: blur(6px) brightness(1.006);
}
.kicker {
  margin: 0 0 18px;
  color: rgba(255,255,255,.78);
  font-size: .82rem;
  font-weight: 300;
  letter-spacing: .035em;
  text-transform: lowercase;
}
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--font-display); }
h1, h2, h3, .kicker, time, .project-card strong, .contact-card a {
  text-shadow: 0 1px 18px rgba(0,0,0,.30);
}

h1 {
  margin-bottom: clamp(20px, 3vw, 30px);
  font-size: clamp(3.45rem, 8.4vw, 7.25rem);
  font-weight: 300;
  line-height: .92;
  letter-spacing: -.072em;
}
h1 span { display: block; }
.hero__panel .kicker {
  margin: 0;
  max-width: none;
  width: 100%;
  white-space: nowrap;
  font-size: clamp(.82rem, 1.45vw, 1.16rem);
  line-height: 1.35;
  letter-spacing: .005em;
  text-transform: lowercase;
}
h2 {
  margin: 0 0 22px;
  font-size: clamp(1.55rem, 3.05vw, 3.05rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -.048em;
}
.hero p:not(.kicker), .text-block p, .list p, .contact-card a {
  max-width: 790px;
  margin-bottom: 1.05rem;
  color: rgba(255,255,255,.94);
  text-shadow: 0 1px 18px rgba(0,0,0,.32);
  font-size: clamp(1.02rem, 1.35vw, 1.18rem);
}
.section--text { }
.section--text .section-pill {
  display: grid;
  grid-template-columns: minmax(180px, .34fr) minmax(0, .66fr);
  gap: clamp(28px, 7vw, 92px);
  align-items: start;
}
.section-heading {
  display: grid;
  gap: clamp(18px, 3vw, 28px);
  align-content: start;
}
.section-heading h2 { margin-bottom: 0; }
.portrait-line {
  width: min(100%, 280px);
  aspect-ratio: 1 / 1;
  object-fit: contain;
  opacity: .95;
  filter: drop-shadow(0 1px 18px rgba(0,0,0,.28));
}
.text-block, .list {
  padding: 0;
}
.text-block p:last-child { margin-bottom: 0; }
.list article {
  display: grid;
  grid-template-columns: 120px minmax(0,1fr);
  gap: 22px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(255,255,255,.18);
}
.list article:first-child { padding-top: 0; }
.list article:last-child { padding-bottom: 0; border-bottom: 0; }
time {
  color: rgba(255,255,255,.72);
  font-size: .93rem;
  font-weight: 300;
}
.list p { margin: 0; }

.projects-section h2 { margin-bottom: clamp(24px, 4vw, 44px); }
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2.4vw, 30px);
}
.project-card {
  position: relative;
  display: block;
  min-height: 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
  text-align: left;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform: translateZ(0);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.project-card::after { display: none; }
.project-card:hover, .project-card:focus-visible {
  transform: translateY(-3px);
  background: transparent;
}
.project-card img {
  position: static;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.52);
  border-radius: var(--radius-small);
  box-shadow: 0 18px 55px rgba(21,31,48,.10);
  filter: saturate(.88) contrast(.90) brightness(1.08);
  opacity: .86;
  transition: opacity .35s ease, transform .7s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease;
}
.project-card:hover img, .project-card:focus-visible img {
  opacity: .98;
  transform: scale(1.012);
  box-shadow: 0 24px 65px rgba(21,31,48,.15);
}
.project-card span { display: none; }
.project-card strong {
  display: block;
  margin-top: 10px;
  color: rgba(255,255,255,.86);
  font-size: .88rem;
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: -.01em;
}
.section--contact { padding-bottom: 150px; }
.contact-card a {
  display: inline-block;
  margin: 0;
  text-decoration: none;
  font-size: clamp(1.4rem, 3vw, 2.8rem);
  letter-spacing: -.045em;
}
.contact-card a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 7px; }

.project-modal {
  width: min(94vw, 1280px);
  height: min(82vh, 760px);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  overflow: hidden;
  box-sizing: border-box;
}
.project-modal::backdrop {
  background: rgba(0,0,0,.18);
  backdrop-filter: blur(8px);
}
.modal-close {
  position: absolute;
  z-index: 4;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.34);
  color: rgba(255,255,255,.95);
  font-size: 1.35rem;
  line-height: 1;
}
.project-modal[open] {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .78fr);
  gap: 12px;
}
.project-modal__media,
.project-modal__content {
  min-width: 0;
  min-height: 0;
  height: 100%;
  border-radius: var(--radius);
  overflow: hidden;
}
.project-modal__media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.project-modal__content {
  padding: clamp(24px, 3.2vw, 44px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.project-modal__content h2 {
  margin-bottom: clamp(16px, 2vw, 24px);
  font-size: clamp(2rem, 4vw, 4.1rem);
  line-height: .98;
}
.project-modal__content p {
  color: rgba(255,255,255,.94);
  font-size: clamp(.88rem, 1.25vw, 1.04rem);
  line-height: 1.62;
}
.project-modal__content a {
  display: inline-block;
  margin-top: 4px;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

[data-reveal] {
  opacity: 0;
  --reveal-y: 24px;
  transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1), background .45s ease, border-color .45s ease, box-shadow .45s ease;
}
[data-reveal].is-visible { opacity: 1; --reveal-y: 0px; }

@media (max-width: 860px) {
  .nav { align-items: flex-start; padding: 13px 14px; }
  .nav__links { display: none; }
  .section { padding: 86px 0; }
  .section--text .section-pill { grid-template-columns: 1fr; gap: 20px; }
  .portrait-line { width: min(68vw, 260px); }
  .hero__panel { width: min(86vw, 480px); }
  h1 { font-size: clamp(3.15rem, 13vw, 5.8rem); }
  .hero__panel .kicker { font-size: clamp(.72rem, 2.65vw, .92rem); }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 3vw, 22px); }
  .list article { grid-template-columns: 1fr; gap: 6px; }
  .project-modal { width: min(92vw, 620px); height: min(86vh, 760px); }
  .project-modal[open] { grid-template-columns: 1fr; grid-template-rows: 38% minmax(0, 1fr); overflow: hidden; }
  .project-modal__media img { min-height: 0; max-height: none; }
  .project-modal__content { max-height: none; padding: clamp(20px, 5vw, 32px); justify-content: center; }
  .project-modal__content h2 { font-size: clamp(1.9rem, 8vw, 3.2rem); }
  .project-modal__content p { font-size: clamp(.82rem, 3.2vw, .96rem); line-height: 1.5; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}

/* Language links inside the first glass tile */
.hero__panel {
  position: relative;
}
.hero__panel h1 {
  font-size: clamp(2.85rem, 7.05vw, 6.15rem);
  line-height: .94;
  letter-spacing: -.062em;
}
.hero-links {
  position: absolute;
  left: clamp(30px, 5vw, 58px);
  bottom: clamp(22px, 4vw, 42px);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,.92);
  font-family: var(--font-body);
  font-size: clamp(.68rem, .9vw, .76rem);
  font-weight: 300;
  letter-spacing: .015em;
  text-shadow: 0 1px 14px rgba(0,0,0,.36);
}
.hero-links button,
.hero-links a {
  color: inherit;
  text-decoration: none;
  opacity: .72;
  line-height: 1;
  transition: opacity .22s ease, text-decoration-color .22s ease;
}
.hero-links button[aria-pressed="true"],
.hero-links button:hover,
.hero-links a:hover {
  opacity: 1;
}
.hero-links button[aria-pressed="true"] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.hero-links::before {
  content: "";
  width: 1px;
  height: .78em;
  order: 3;
  margin-left: 1px;
  background: rgba(255,255,255,.36);
}
.hero-links a { order: 4; }
.hero-links [data-lang="ca"] { order: 0; }
.hero-links [data-lang="en"] { order: 1; }
.hero-links [data-lang="sp"] { order: 2; }

@media (max-width: 860px) {
  .hero__panel h1 { font-size: clamp(2.72rem, 11.2vw, 5.1rem); line-height: .96; }
  .hero-links {
    left: clamp(30px, 5vw, 58px);
    bottom: clamp(22px, 4vw, 42px);
    gap: 10px;
  }
}
