/* Tres Cops Rebel — shared design tokens & base styles */

:root {
  --red: #9a2020;
  --red-deep: #7a1818;
  --cream: #f4e8c8;
  --cream-soft: #f8f0d8;
  --ink: #1a0a0a;

  --font-display: "Anton", "Bebas Neue", "Impact", system-ui, sans-serif;
  --font-body: "Nunito", "Helvetica Neue", system-ui, sans-serif;

  --max-w: 1440px;
  --pad: clamp(1.25rem, 4vw, 4rem);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 0.92;
  margin: 0;
  text-transform: uppercase;
}

p { margin: 0 0 1em; }
ul { margin: 0; padding-left: 1.2em; }
li { margin-bottom: 0.4em; }

/* Focus-visible styles -------------------------------- */
:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 2px;
}
.bg-cream :focus-visible,
.offer :focus-visible,
.casals :focus-visible {
  outline-color: var(--red);
}

/* Skip link ------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--pad);
  background: var(--cream);
  color: var(--red);
  padding: 0.5em 1em;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  z-index: 100;
  border-radius: 0 0 4px 4px;
}
.skip-link:focus {
  top: 0;
}

/* Visually hidden (screen-reader only) ---------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Reusable building blocks */

.tag {
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: clamp(0.95rem, 1.3vw, 1.15rem);
  display: grid;
  gap: 0.4em;
}
.contact-list li {
  display: flex;
  align-items: center;
  gap: 0.7em;
  margin: 0;
}
.contact-list a {
  text-decoration: none;
}
.contact-list a:hover {
  text-decoration: underline;
}

.section {
  min-height: 100vh;
  display: grid;
  position: relative;
  overflow: hidden;
}

/* Section variants */

.bg-red    { background: var(--red); color: var(--cream); }
.bg-cream  { background: var(--cream); color: var(--red); }

/* Top label that appears on every section */
.section-label {
  position: absolute;
  top: clamp(1rem, 2.5vw, 2rem);
  left: var(--pad);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  z-index: 3;
}
/* Labels inherit section color by default (cream on red, red on cream).
   Sections with explicit bg-cream/bg-red already set the right text color.
   For sections without a bg class, inherit from parent. */

/* Big display heading sizing */
.display-xl { font-size: clamp(3rem, 11vw, 11rem); }
.display-lg { font-size: clamp(2.5rem, 8vw, 7.5rem); }
.display-md { font-size: clamp(1.8rem, 4.5vw, 3.5rem); }

/* Hero -------------------------------------------- */
.hero {
  grid-template-columns: 1.05fr 1fr;
}
.hero__panel {
  background: var(--red);
  color: var(--cream);
  padding: var(--pad);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 2rem;
  position: relative;
}
.hero__top { display: grid; gap: 1.25rem; }
.hero__title { display: grid; gap: 0.5rem; align-self: end; }
.hero__title .tagline {
  font-size: clamp(1rem, 1.8vw, 1.5rem);
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.hero__brand { font-size: clamp(3rem, 10vw, 9rem); }
.hero__photo {
  background-size: cover;
  background-position: center;
}

/* Qui som -------------------------------------------- */
.about {
  grid-template-columns: 0.95fr 1fr;
}
.about__panel {
  background: var(--red);
  color: var(--cream);
  padding: var(--pad);
  display: grid;
  align-content: center;
  gap: 1.5rem;
}
.about__title { font-size: clamp(3rem, 12vw, 10rem); }
.about__photo {
  background-size: cover;
  background-position: center;
}

/* Per què (values) -------------------------------------------- */
.values {
  padding: var(--pad);
  padding-top: calc(var(--pad) + 2rem);
  display: grid;
  grid-template-columns: 0.85fr 1fr;
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
}
.values__intro p { font-size: clamp(0.95rem, 1.2vw, 1.1rem); }
.values__list { display: grid; gap: clamp(1rem, 3vw, 2.5rem); }
.value {
  display: grid;
  gap: 0.25rem;
  justify-items: end;
  text-align: right;
}
.value h3 { font-size: clamp(2.2rem, 7vw, 5.5rem); }
.value p {
  max-width: 28em;
  font-size: clamp(0.9rem, 1.1vw, 1rem);
  line-height: 1.35;
}
.values__cta {
  margin-top: 2rem;
  font-size: clamp(1.5rem, 4vw, 3rem);
}

/* Què oferim -------------------------------------------- */
.offer {
  padding: var(--pad);
  padding-top: calc(var(--pad) + 2rem);
  align-content: start;
  position: relative;
}
.offer__title-visual {
  position: absolute;
  bottom: clamp(1rem, 4vw, 3rem);
  right: var(--pad);
  font-size: clamp(3rem, 11vw, 10rem);
  line-height: 0.9;
}
.offer__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  max-width: 90%;
  margin: 0;
}
.offer__col h3 {
  font-family: var(--font-body);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  letter-spacing: 0.05em;
  margin-bottom: 0.6em;
  border-left: 2px solid currentColor;
  padding-left: 0.8em;
}
.offer__col p {
  font-size: clamp(0.9rem, 1.05vw, 1rem);
  margin-bottom: 1em;
  padding-left: 0.8em;
}
.offer__col ul { padding-left: 1.7em; }
.offer__col li { font-size: clamp(0.9rem, 1.05vw, 1rem); }

/* Metodologia -------------------------------------------- */
.method {
  grid-template-columns: 1fr 1fr;
}
.method__panel {
  background: var(--red);
  color: var(--cream);
  padding: var(--pad);
  display: grid;
  align-content: end;
  gap: 0.6rem;
}
.method__list { display: grid; gap: 0.4rem; }
.method__list span { font-size: clamp(1.6rem, 4.5vw, 3.2rem); }
.method__photo {
  background-size: cover;
  background-position: center;
  position: relative;
}
.method__heading {
  position: absolute;
  top: clamp(1rem, 4vw, 3rem);
  right: var(--pad);
  color: var(--red);
  font-size: clamp(3rem, 9vw, 8rem);
  background: var(--cream);
  padding: 0 0.2em;
}

/* Casals i ateneus -------------------------------------------- */
.casals {
  grid-template-columns: 1fr 1fr;
  padding: 0;
}
.casals__text {
  padding: var(--pad);
  padding-top: calc(var(--pad) + 2rem);
  align-content: center;
  display: grid;
  gap: 1.25rem;
}
.casals__text h2 {
  font-size: clamp(2.5rem, 6.5vw, 5rem);
  margin-bottom: 0.5em;
}
.casals__text p { font-size: clamp(0.95rem, 1.2vw, 1.05rem); }
.casals__cta {
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.casals__cta:hover {
  text-decoration: underline;
}
.casals__media {
  background-size: cover;
  background-position: center;
  position: relative;
}
.casals__callout {
  position: absolute;
  bottom: 5%;
  right: 5%;
  width: clamp(220px, 26vw, 360px);
  aspect-ratio: 1;
  background: var(--cream);
  color: var(--red);
  display: grid;
  place-content: center;
  text-align: center;
  padding: 1rem;
  clip-path: polygon(
    50% 0%, 60% 10%, 75% 5%, 80% 18%, 95% 20%,
    90% 35%, 100% 50%, 90% 65%, 95% 80%, 80% 82%,
    75% 95%, 60% 90%, 50% 100%, 40% 90%, 25% 95%,
    20% 82%, 5% 80%, 10% 65%, 0% 50%, 10% 35%,
    5% 20%, 20% 18%, 25% 5%, 40% 10%
  );
}
.casals__callout h3 {
  font-family: var(--font-body);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(1.1rem, 1.6vw, 1.5rem);
  margin-bottom: 0.4em;
}
.casals__callout p {
  font-size: clamp(0.75rem, 0.95vw, 0.9rem);
  line-height: 1.35;
  margin: 0;
}

/* Contacte -------------------------------------------- */
.contact {
  position: relative;
  color: var(--cream);
  padding: var(--pad);
  isolation: isolate;
}
.contact__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: -2;
}
.contact__overlay {
  position: absolute;
  inset: 0;
  background: var(--red);
  opacity: 0.88;
  z-index: -1;
}
.contact__content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 2rem;
  min-height: 100%;
}
.contact__top {
  display: grid;
  gap: 1.5rem;
  margin-top: 3rem;
  align-self: center;
  justify-self: end;
  text-align: right;
  max-width: 36em;
}
.contact__top p {
  font-size: clamp(1rem, 1.5vw, 1.4rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}
.contact__middle .contact-list {
  font-size: clamp(1rem, 1.5vw, 1.4rem);
}
.contact__brand {
  font-size: clamp(3rem, 14vw, 13rem);
  line-height: 0.85;
  margin-top: 1rem;
}

/* Footer ---------------------------------------------- */
.site-footer {
  background: var(--red-deep);
  color: var(--cream);
  padding: 1rem var(--pad);
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}

/* Mobile -------------------------------------------- */
@media (max-width: 820px) {
  .hero, .about, .method, .casals { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .hero__photo, .about__photo, .method__photo, .casals__media {
    min-height: 50vh;
  }
  .values { grid-template-columns: 1fr; }
  .value { justify-items: start; text-align: left; }
  .offer__grid { grid-template-columns: 1fr; max-width: 100%; }
  .offer__title-visual { position: static; margin-top: 2rem; text-align: right; }
  .method__heading { font-size: clamp(2.5rem, 12vw, 5rem); }
  .contact__top { justify-self: start; text-align: left; }
  .section { min-height: auto; }
  .section-label { font-size: 0.8rem; }
}

/* Reduced motion -------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
