/**
 * Pat Equilux, Vidas No Vividas.
 * Static port of the Shopify theme (patequilux-theme). Tokens first, then base, then components.
 */

/* Fonts, self-hosted (SIL Open Font License, see assets/fonts) */
@font-face {
  font-family: 'Gilda Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/gilda-display-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/ibm-plex-mono-latin-400-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/ibm-plex-mono-latin-700-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Pinyon Script';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/pinyon-script-latin-400-normal.woff2') format('woff2');
}

/* Design tokens */
:root {
  --font-primary--family: 'IBM Plex Mono', ui-monospace, 'Courier New', monospace;
  --font-display--family: 'Gilda Display', 'Times New Roman', serif;
  --font-script--family: 'Pinyon Script', cursive;

  --page-width: 90rem;
  --page-margin: 20px;

  --color-paper: #f3eee6;
  --color-ink: #161414;
  --color-rose: #e3868f;
  --color-night: #0c0b0b;
  --color-oxblood: #6a1421;
  --color-window: #f2c784;
  --color-background: var(--color-paper);
  --color-foreground: var(--color-ink);

  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: clamp(1.125rem, 1rem + 0.6vw, 1.5rem);
  --text-display: clamp(2.75rem, 1.5rem + 7vw, 8.5rem);
  --text-script: clamp(3.5rem, 1rem + 13vw, 13rem);
  --tracking-caps: 0.18em;
  --leading-body: 1.65;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: clamp(3rem, 2rem + 4vw, 6rem);
  --space-xl: clamp(5rem, 3rem + 8vw, 11rem);
  --measure: 38rem;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-reveal: 1.2s;
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
}

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  font-family: var(--font-primary--family);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  background-color: var(--color-background);
  color: var(--color-foreground);
  -webkit-font-smoothing: antialiased;
}

img,
picture,
video,
canvas,
svg,
iframe {
  display: block;
  max-width: 100%;
}

img,
picture,
video {
  height: auto;
}

p {
  text-wrap: pretty;
  overflow-wrap: break-word;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

:focus-visible {
  outline: 1px solid currentcolor;
  outline-offset: 4px;
}

::selection {
  background-color: var(--color-rose);
  color: var(--color-ink);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--color-paper);
  color: var(--color-ink);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/**
 * Section layout: a three column grid that keeps content inside the page
 * width with a minimum margin. Children with `full-width` span the viewport.
 */
.section {
  --content-width: min(calc(var(--page-width) - var(--page-margin) * 2), calc(100% - var(--page-margin) * 2));
  --content-margin: minmax(var(--page-margin), 1fr);
  --content-grid: var(--content-margin) var(--content-width) var(--content-margin);
  position: relative;
  display: grid;
  grid-template-columns: var(--content-grid);
  width: 100%;
}

.section > * {
  grid-column: 2;
}

.section > .full-width {
  grid-column: 1 / -1;
}

/* Type styles */
.type-caps {
  font-family: var(--font-display--family);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  line-height: 1.4;
}

.type-display {
  font-family: var(--font-display--family);
  font-size: var(--text-display);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 0.9;
  text-transform: uppercase;
}

.type-script {
  font-family: var(--font-script--family);
  font-size: var(--text-script);
  font-weight: 400;
  line-height: 0.8;
}

/* Color schemes */
.scheme-paper {
  --color-background: var(--color-paper);
  --color-foreground: var(--color-ink);
}

.scheme-night {
  --color-background: var(--color-night);
  --color-foreground: var(--color-paper);
}

.scheme-rose {
  --color-background: var(--color-rose);
  --color-foreground: var(--color-ink);
}

.scheme-oxblood {
  --color-background: var(--color-oxblood);
  --color-foreground: var(--color-paper);
}

:is(.scheme-paper, .scheme-night, .scheme-rose, .scheme-oxblood) {
  background-color: var(--color-background);
  color: var(--color-foreground);
}

/* Perforation motif: punched dots, like the die-cut lettering and calados */
.perforation {
  --dot: 2px;
  --gap: 9px;
  height: calc(var(--gap) * 3);
  background-image: radial-gradient(circle, currentcolor var(--dot), transparent calc(var(--dot) + 0.5px));
  background-size: var(--gap) var(--gap);
  background-position: center;
  opacity: 0.55;
}

/* Scroll reveal, progressively enhanced by site.js */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(1.5rem);
    transition:
      opacity var(--duration-reveal) var(--ease-out),
      transform var(--duration-reveal) var(--ease-out);
    transition-delay: var(--reveal-delay, 0s);
  }

  .js [data-reveal].is-revealed {
    opacity: 1;
    transform: none;
  }
}

/* Header */
.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
}

/* Three columns: first item to the left, second exactly centred, last to the right */
.site-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-sm);
  min-height: 4.5rem;
  color: var(--color-paper);
}

.site-header__inner > :first-child {
  justify-self: start;
}

.site-header__inner > :nth-child(2) {
  justify-self: center;
}

.site-header__inner > :last-child {
  justify-self: end;
}

@media (max-width: 359px) {
  .site-header__inner {
    gap: 0.5rem;
  }
}

.site-header a {
  text-decoration: none;
  white-space: nowrap;
}

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

.site-header__menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.site-header__social {
  display: flex;
  justify-content: flex-end;
}

/* Opening: title, brand and the film, all within the first screen */
.opening {
  display: grid;
  grid-template-columns: var(--content-grid);
  align-content: center;
  min-height: 100svh;
  padding-block: calc(4.5rem + var(--space-sm)) var(--space-md);
}

.opening > * {
  grid-column: 2;
}

.opening__inner {
  --frame-width: min(100%, 72rem, max(30rem, calc((100svh - 20rem) * 16 / 9)));
  display: grid;
  justify-items: center;
  gap: var(--space-md);
}

.opening__masthead {
  display: grid;
  gap: var(--space-md);
  width: var(--frame-width);
}

.opening__title {
  margin: 0;
  font-weight: 400;
}

.opening__title img {
  width: min(100%, 40rem);
  height: auto;
  margin-inline: auto;
  animation: opening-draw 2.4s var(--ease-out) both;
}

.opening__brand p {
  margin: 0;
}

.opening__name {
  font-size: clamp(1.5rem, 1rem + 2vw, 2.75rem);
  letter-spacing: -0.04em;
}

/* Name over event, centred under the title like the film below */
.opening__brand {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  text-align: center;
}

@media (max-width: 749px) {
  .opening {
    min-height: 0;
    padding-block: 6.5rem var(--space-lg);
  }

  .opening__masthead {
    gap: 2.2rem;
  }
}

@keyframes opening-draw {
  from {
    opacity: 0;
    filter: blur(6px);
  }
  to {
    opacity: 1;
    filter: none;
  }
}

/* Editorial text */
.editorial-text {
  display: grid;
  grid-template-columns: var(--content-grid);
  padding-block: var(--editorial-padding-top, 120px) var(--editorial-padding-bottom, 120px);
}

.editorial-text > * {
  grid-column: 2;
}

.editorial-text__perforation {
  margin-bottom: var(--space-lg);
}

.editorial-text__inner {
  display: grid;
  gap: 1.75em;
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
}

.editorial-text__block--lead {
  font-size: var(--text-lg);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.editorial-text__block--statement {
  font-family: var(--font-display--family);
  font-size: clamp(1.75rem, 1.1rem + 2.6vw, 3.25rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.editorial-text__block--caps {
  font-family: var(--font-display--family);
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

/*
 * Rhinestone flowers from page 1 of the dossier. The image is used as a mask, so the flower takes
 * the colour of each section; a band of light sweeps across it now and then. --bloom (0 to 1)
 * reveals it from the stem up, driven by site.js in the lives section.
 */
.flower {
  --bloom: 1;
  --flower-color: color-mix(in srgb, var(--color-foreground) 80%, transparent);
  aspect-ratio: var(--flower-ratio);
  background:
    linear-gradient(105deg, transparent 42%, rgb(255 255 255 / 0.95) 50%, transparent 58%) no-repeat,
    var(--flower-color);
  background-size: 300% 100%, auto;
  background-position: 150% 0, 0 0;
  -webkit-mask-image:
    linear-gradient(to top, #000 calc(var(--bloom) * 115% - 15%), transparent calc(var(--bloom) * 115%)),
    var(--flower-image);
  mask-image:
    linear-gradient(to top, #000 calc(var(--bloom) * 115% - 15%), transparent calc(var(--bloom) * 115%)),
    var(--flower-image);
  -webkit-mask-size: 100% 100%, contain;
  mask-size: 100% 100%, contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
  animation: flower-shine 9s ease-in-out infinite;
}

.flower--grande {
  --flower-ratio: 640 / 1659;
  --flower-image: url('/assets/img/flor-grande.webp');
}

.flower--pequena {
  --flower-ratio: 440 / 1124;
  --flower-image: url('/assets/img/flor-pequena.webp');
}

@keyframes flower-shine {
  0% {
    background-position: 150% 0, 0 0;
  }
  45%,
  100% {
    background-position: -50% 0, 0 0;
  }
}

/* The lives: continuous text with the large flower beside it, blooming while you read */
.lives {
  display: grid;
  grid-template-columns: var(--content-grid);
  padding-block: var(--space-xl) var(--space-lg);
}

.lives > * {
  grid-column: 2;
}

.lives__inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--space-lg);
  align-items: start;
}

.lives__flower {
  position: sticky;
  top: 8svh;
  display: grid;
  justify-items: center;
}

.lives__flower .flower {
  height: min(84svh, 52rem);
  max-width: 100%;
}

.lives__text {
  display: grid;
  gap: 1.6em;
  max-width: 32rem;
  padding-top: 12svh;
  font-size: var(--text-lg);
  line-height: 1.55;
}

.lives__kicker {
  font-weight: 400;
  color: var(--color-rose);
}

.lives__outro {
  display: grid;
  gap: 1.25em;
  padding-top: var(--space-md);
}

.lives__closing {
  font-family: var(--font-display--family);
  font-size: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  line-height: 1.15;
  text-wrap: balance;
}

@media (max-width: 749px) {
  .lives__inner {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .lives__flower {
    display: none;
  }

  .lives__text {
    padding-top: 0;
  }
}

/* Closing: the campaign story poster between the two flowers */
.closing {
  display: grid;
  grid-template-columns: var(--content-grid);
  padding-block: var(--space-xl);
}

.closing > * {
  grid-column: 2;
}

.closing__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-lg);
}

.closing__story {
  display: block;
  width: min(100%, 28rem, calc(86svh * 9 / 16));
}

.closing__story img {
  width: 100%;
  height: auto;
}

.closing__flower {
  display: flex;
  justify-content: center;
}

.closing__flower .flower {
  height: min(70svh, 40rem);
}

/* Both flowers face outwards: mirrored, the small one leans left and the large one right */
.closing__flower .flower {
  transform: scaleX(-1);
}

@media (max-width: 899px) {
  .closing__inner {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .closing__flower {
    display: none;
  }
}

/* Campaign video */
.campaign-video__frame {
  position: relative;
  display: block;
  width: var(--frame-width, min(100%, 72rem));
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: #000;
}

.campaign-video__media {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Cover image and play button: only with JavaScript, hidden once the film has started */
.campaign-video__poster {
  display: none;
}

.js .campaign-video__poster {
  position: absolute;
  inset: 0;
  display: block;
}

.campaign-video__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.campaign-video__play {
  position: absolute;
  inset: 0;
  display: none;
  align-content: end;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0 0 clamp(0.75rem, 4%, 2.25rem);
  color: var(--color-paper);
  background: linear-gradient(to top, rgb(0 0 0 / 0.55), transparent 45%);
  border: 0;
  cursor: pointer;
  transition: background-color 0.6s var(--ease-out);
}

.js .campaign-video__play {
  display: grid;
  grid-auto-flow: column;
  align-items: center;
}

.campaign-video__play-icon {
  position: relative;
  display: block;
  width: clamp(2.5rem, 5vw, 3.5rem);
  aspect-ratio: 1;
  border: 1px solid currentcolor;
  border-radius: 50%;
  transition: background-color 0.4s var(--ease-out);
}

.campaign-video__play-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 54%;
  border-block: 0.4rem solid transparent;
  border-left: 0.65rem solid currentcolor;
  transform: translate(-50%, -50%);
}

.campaign-video__play:hover .campaign-video__play-icon,
.campaign-video__play:focus-visible .campaign-video__play-icon {
  background-color: rgb(255 255 255 / 0.12);
}

.campaign-video__frame.is-started :is(.campaign-video__poster, .campaign-video__play) {
  display: none;
}

.campaign-video__caption {
  text-align: center;
  opacity: 0.7;
}

/* Footer */
.site-footer {
  display: grid;
  grid-template-columns: var(--content-grid);
  padding-block: var(--space-md);
}

.site-footer > * {
  grid-column: 2;
}

.site-footer__inner {
  display: grid;
  gap: var(--space-md);
}

.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
}

.site-footer a {
  text-decoration: none;
}

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

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

/* Simple text pages: legal notice, privacy, 404 */
.page {
  display: grid;
  grid-template-columns: var(--content-grid);
  flex: 1;
  align-content: start;
  padding-block: calc(var(--space-lg) + 3rem) var(--space-xl);
}

.page > * {
  grid-column: 2;
}

.page__inner {
  display: grid;
  align-content: start;
  gap: 1.25em;
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
}

.page__title {
  font-family: var(--font-display--family);
  font-size: clamp(2rem, 1.2rem + 3vw, 3.5rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.page h2 {
  margin-top: 1em;
  font-family: var(--font-display--family);
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.page ul {
  padding-left: 1.25em;
}

.page .site-header__inner {
  color: var(--color-foreground);
}

.page-header {
  position: static;
}

.page-header .site-header__inner {
  color: var(--color-foreground);
}

@media (prefers-reduced-motion: reduce) {
  .opening__title img,
  .flower {
    animation: none;
  }
}
