@font-face { font-family: 'Gloock'; src: url('/fonts/gloock.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Familjen Grotesk'; src: url('/fonts/familjen.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

:root {
  --green: #17392f;
  --green-deep: #0f2a22;
  --clay: #ad4c29;
  --clay-deep: #93401f;
  --chalk: #fbfbf7;
  --stone: #e5e3da;
  --stone-dark: #5c5b52;
  --ball: #e3ee5e;
  --ink: #16211c;
  --display: 'Gloock', Georgia, serif;
  --text: 'Familjen Grotesk', system-ui, sans-serif;
  --gutter: clamp(16px, 5vw, 56px);
  --dock: calc(60px + env(safe-area-inset-bottom));
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--stone); color: var(--ink); font: 400 1.0625rem/1.6 var(--text); padding-bottom: var(--dock); overflow-wrap: break-word; }
img, video { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.08; margin: 0; }
h2 { font-size: clamp(2.1rem, 6.4vw, 3.6rem); }
h3 { font-size: 1.45rem; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ball); outline-offset: 2px; box-shadow: 0 0 0 5px var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { width: min(100%, 1180px); margin-inline: auto; padding-inline: var(--gutter); }
.lead { font-size: 1.2rem; line-height: 1.5; max-width: 34em; margin-top: 14px; }

.skip { position: absolute; left: 12px; top: -60px; background: var(--ball); color: var(--ink); padding: 10px 14px; z-index: 50; }
.skip:focus { top: 8px; }

/* Capçalera */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 6px var(--gutter); background: var(--green); color: var(--chalk); }
.brand { font: 400 1.3rem/1 var(--display); text-decoration: none; margin-right: auto; }
.nav a { text-decoration: none; }
.nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.lang, .menu { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; color: inherit; font: 600 1rem var(--text); background: none; border: 0; padding: 0 6px; text-decoration: none; cursor: pointer; }
.menu { border: 1.5px solid currentColor; padding: 0 12px; }
.nav { display: none; }
.nav.is-open { display: flex; flex-direction: column; position: absolute; inset: 100% 0 auto 0; background: var(--green); padding: 8px var(--gutter) 20px; border-top: 1px solid rgb(255 255 255 / .2); height: calc(100dvh - 60px); }
.nav.is-open a { font: 400 1.9rem/1 var(--display); padding: 16px 0; }

/* Botons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 12px 22px; font: 600 1.05rem/1.2 var(--text); text-decoration: none; border: 2px solid transparent; cursor: pointer; }
.btn-ball { background: var(--ball); color: var(--ink); }
.btn-ball:hover { background: var(--chalk); }
.btn-ghost { border-color: var(--chalk); color: var(--chalk); }
.btn-ghost:hover { background: var(--chalk); color: var(--green); }
.btn-chalk { background: var(--chalk); color: var(--ink); }
.btn-chalk:hover { background: var(--ball); }
.text-link { display: inline-block; font-weight: 600; text-underline-offset: 4px; padding-block: 10px; }

/* Portada */
.hero { background: var(--green); color: var(--chalk); display: flex; flex-direction: column-reverse; }
.hero-img img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.hero-text { padding: 22px var(--gutter) 34px; }
.hero-name { font-weight: 600; }
.hero h1 { font-size: clamp(2.9rem, 13.5vw, 6.1rem); line-height: 1; margin: 10px 0 14px; letter-spacing: -.005em; }
.hero-lead { font-size: 1.2rem; line-height: 1.45; max-width: 26em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

.proof { background: var(--green); color: var(--chalk); padding: 0 var(--gutter) 28px; display: grid; gap: 0; }
.proof li { padding: 14px 0; border-top: 2px solid var(--chalk); }
.proof strong { display: block; font: 400 1.35rem/1.2 var(--display); }
.proof span { display: block; font-size: 1rem; opacity: .86; margin-top: 2px; }

/* Classes: la pista */
.classes { background: var(--clay); color: var(--chalk); padding-block: 52px; }
.classes-grid { display: grid; gap: 22px; margin-top: 26px; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 0; margin: 0 0 14px; padding: 0; }
.modes label { cursor: pointer; }
.modes input, .zone input, .choices input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.modes span { display: flex; align-items: center; justify-content: center; min-height: 48px; font-weight: 600; border: 2px solid var(--chalk); }
.modes label:first-of-type span { border-right: 0; }
.modes input:checked + span { background: var(--chalk); color: var(--clay-deep); }
.modes input:focus-visible + span, .zone input:focus-visible + span, .choices input:focus-visible + span { outline: 3px solid var(--ball); outline-offset: 2px; }

.court { position: relative; display: grid; grid-template-rows: repeat(3, 1fr); aspect-ratio: 4 / 3; margin: 0; padding: 0; border: 0; background: var(--clay-deep); color: var(--chalk); }
.court-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.zone { position: relative; display: flex; align-items: center; justify-content: flex-start; cursor: pointer; padding-left: 16%; }
.zone span { font: 400 clamp(1.25rem, 5.4vw, 1.75rem)/1 var(--display); padding: 6px 10px; background: var(--clay-deep); }
.zone input:checked + span { background: var(--chalk); color: var(--clay-deep); }
.ball { position: absolute; right: 20%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; background: var(--ball); box-shadow: 0 3px 0 rgb(0 0 0 / .25); transition: top .5s cubic-bezier(.3, .7, .3, 1); top: 83.3%; }
.court[data-level='per'] .ball { top: 50%; }
.court[data-level='com'] .ball { top: 16.6%; }

.panel + .panel { margin-top: 28px; }
.js .panel[hidden] { display: none; }
.js .panel + .panel { margin-top: 0; }
.panel h3 { font-size: 1.8rem; }
.panel h3 span { font: 600 1rem var(--text); white-space: nowrap; }
.who { font-size: 1.15rem; line-height: 1.4; margin-top: 8px; }
.panel ul { margin: 14px 0 20px; }
.panel li { padding: 9px 0; border-top: 1px solid rgb(255 255 255 / .4); }

.extra { margin-top: 40px; padding-top: 18px; border-top: 2px solid var(--chalk); display: grid; gap: 8px; }
.extra p { max-width: 38em; margin-top: 6px; }
.extra a { font-weight: 600; text-underline-offset: 4px; padding-block: 10px; justify-self: start; }

/* Mètode */
.method { background: var(--stone); }
.method figure img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.method-text { padding: 36px var(--gutter) 48px; }
.method-text p { max-width: 32em; margin-top: 14px; font-size: 1.15rem; }

/* Vídeos */
.tips { background: var(--green); color: var(--chalk); padding-block: 52px; }
.videos { display: grid; grid-auto-flow: column; grid-auto-columns: min(74vw, 300px); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 24px calc(var(--gutter) * -1) 10px; padding: 0 var(--gutter) 8px; }
.videos figure { scroll-snap-align: center; }
.videos video { width: 100%; aspect-ratio: 9 / 16; background: var(--green-deep); object-fit: cover; }
.videos figcaption { margin-top: 8px; font-weight: 600; }

/* Campió */
.final { background: var(--green-deep); color: var(--chalk); padding-block: 52px; }
.final-grid { display: grid; gap: 28px; }
.final .btn { margin-top: 20px; }
.final table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.final th, .final td { text-align: left; padding: 11px 8px 11px 0; border-top: 1px solid rgb(255 255 255 / .28); font-weight: 400; vertical-align: baseline; }
.final th { font-size: .95rem; opacity: .8; white-space: nowrap; }
.final .score { text-align: right; white-space: nowrap; padding-right: 0; font-weight: 600; }
.final small { display: block; font-size: .8rem; font-weight: 400; opacity: .8; }
.final .is-final td, .final .is-final th { border-top: 3px solid var(--ball); opacity: 1; color: var(--ball); }
.final .is-final td { font: 400 1.3rem/1.2 var(--display); }
.source { font-size: .95rem; opacity: .85; }

/* Trajectòria */
.bio { padding-block: 52px; }
.bio-grid { display: grid; gap: 26px; }
.bio figure img { width: 100%; }
.timeline { margin-top: 18px; }
.timeline li { padding: 13px 0; border-top: 2px solid var(--ink); }
.timeline strong { display: block; font: 400 1.25rem/1.2 var(--display); }
.timeline p { margin-top: 3px; max-width: 36em; }

/* Blog */
.blog-home { padding-block: 0 52px; }
.blog-home h2 { border-top: 2px solid var(--ink); padding-top: 26px; }
.posts { margin-top: 16px; }
.post { padding: 18px 0; border-top: 1px solid var(--stone-dark); display: grid; gap: 4px; }
.post[hidden] { display: none; }
.post h3 a { text-underline-offset: 4px; text-decoration-thickness: 2px; }
.post h3 + p { margin-top: 6px; max-width: 38em; }
.post-date { font-size: .95rem; color: var(--stone-dark); }
.post-state { font-size: .95rem; font-weight: 600; color: var(--clay-deep); margin-top: 4px; }
.post-state:empty { display: none; }

/* Contacte */
.contact { background: var(--clay); color: var(--chalk); padding-block: 52px; }
.contact-grid { display: grid; gap: 40px; }
form { margin-top: 22px; display: grid; gap: 16px; }
.field { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; font-weight: 600; min-width: 0; }
.field legend { padding: 0; margin-bottom: 6px; }
.field select, .field textarea { width: 100%; min-height: 50px; padding: 12px; font: 400 1.0625rem var(--text); color: var(--ink); background: var(--chalk); border: 2px solid var(--chalk); border-radius: 0; }
.row { display: grid; gap: 16px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; }
.choices label { cursor: pointer; }
.choices span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 50px; padding: 6px; border: 2px solid var(--chalk); font-weight: 600; }
.choices label:first-child span { border-right: 0; }
.choices input:checked + span { background: var(--chalk); color: var(--clay-deep); }
.form-msg { background: var(--chalk); color: var(--clay-deep); font-weight: 600; padding: 10px 12px; }
form .btn { width: 100%; }
.contact-side h3 { margin-top: 26px; margin-bottom: 8px; }
.contact-side h3:first-child { margin-top: 0; }
.contact-side li { padding: 4px 0; }
.contact-side a { text-underline-offset: 3px; }
.contact-side p { margin-top: 6px; }
.travel { font-size: 1rem; }
.book { display: flex; align-items: center; gap: 12px; margin-top: 30px !important; padding-top: 14px; border-top: 1px solid rgb(255 255 255 / .4); font-size: .95rem; line-height: 1.4; }
.book > img { flex: none; width: 48px; height: 72px; object-fit: cover; }
.club { display: flex; align-items: flex-start; gap: 12px; }
.club img { flex: none; width: 56px; height: 56px; border-radius: 4px; background: #fff; }
.amazon { display: inline-flex; align-items: center; gap: 6px; vertical-align: bottom; }
.amazon img { flex: none; width: 24px; height: 24px; border-radius: 3px; background: #fff; }

/* Peu */
.foot { background: var(--green-deep); color: var(--chalk); padding: 30px var(--gutter); }
.foot-in { width: min(100%, 1068px); margin-inline: auto; }
.foot-name { font: 400 1.5rem/1 var(--display); margin-bottom: 12px; }
.foot li { padding: 5px 0; }
.foot a { text-underline-offset: 3px; }

/* Barra fixa mòbil */
.dock { position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 2fr 1fr; padding-bottom: env(safe-area-inset-bottom); background: var(--green-deep); }
.dock a { display: flex; align-items: center; justify-content: center; gap: 8px; height: 60px; font-weight: 600; text-decoration: none; }
.dock-wa { background: var(--ball); color: var(--ink); }
.dock-call { color: var(--chalk); }

/* Pàgines interiors */
.page-main { padding-block: 34px 56px; }
.page-main h1 { font-size: clamp(2.5rem, 8vw, 4.2rem); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.filters button { min-height: 44px; padding: 8px 14px; font: 600 1rem var(--text); color: var(--ink); background: none; border: 2px solid var(--ink); cursor: pointer; }
.filters [aria-pressed='true'] { background: var(--ink); color: var(--chalk); }
.article { max-width: 760px; }
.article > p, .article > blockquote { font-size: 1.15rem; line-height: 1.68; margin-top: 18px; max-width: 36em; }
.article h1 { margin-top: 8px; }
.article h2 { font-size: 1.7rem; margin-top: 40px; }
.article figure { margin-top: 20px; }
.article .post-date { font-size: .95rem; margin-top: 10px; }
.article .post-date span { display: block; }
.article .article-lead { font-size: 1.3rem; line-height: 1.45; }
.article blockquote { font: 400 1.8rem/1.2 var(--display); margin-inline: 0; color: var(--clay-deep); }
.article a { text-underline-offset: 3px; }
.article h2 .day { display: block; margin-bottom: 4px; font: 600 1rem/1.3 var(--text); color: var(--clay-deep); }
.article > p.point { padding-left: 16px; border-left: 3px solid var(--clay); }
.article > p.point strong { display: block; }
.article .results { width: 100%; max-width: 36em; margin-top: 26px; border-collapse: collapse; font-size: 1rem; }
.article .results th, .article .results td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--stone); text-align: left; font-weight: 400; vertical-align: top; }
.article .results th { color: var(--stone-dark); white-space: nowrap; }
.article .results .score { text-align: right; padding-right: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.article .results .is-final th, .article .results .is-final td { border-bottom: 2px solid var(--ink); font-weight: 600; color: var(--ink); }
.article-end { margin-top: 44px; padding-top: 20px; border-top: 2px solid var(--ink); display: grid; gap: 12px; justify-items: start; }
.article-end p { font: 400 1.6rem/1.2 var(--display); }

@media (min-width: 640px) {
  .proof { grid-template-columns: repeat(3, 1fr); column-gap: 24px; }
  .row { grid-template-columns: 1fr 1fr; }
  .post { grid-template-columns: 170px 1fr; gap: 20px; }
  .videos { grid-auto-flow: initial; grid-template-columns: repeat(2, minmax(0, 300px)); overflow: visible; margin-inline: 0; padding-inline: 0; }
  .foot-in { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; flex-wrap: wrap; }
  .foot ul { display: flex; flex-wrap: wrap; gap: 4px 22px; }
}

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .dock { display: none; }
  .menu { display: none; }
  .nav { display: flex; gap: 24px; font-weight: 600; }
  .lang { order: 3; }
  .hero { display: grid; grid-template-columns: minmax(0, 1fr) min(58vw, 1000px); min-height: min(78vh, 720px); }
  .hero-text { align-self: center; padding: 40px 40px 40px var(--gutter); }
  .hero h1 { font-size: clamp(3.4rem, 5.6vw, 5.6rem); }
  .hero-img { position: relative; }
  .hero-img img { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; object-position: 30% 50%; }
  .classes, .tips, .final, .contact, .bio { padding-block: 84px; }
  .classes-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
  .extra { grid-template-columns: 1fr auto; align-items: center; gap: 40px; }
  .method { display: grid; grid-template-columns: 1fr 1fr; }
  .method figure img { aspect-ratio: auto; min-height: 520px; }
  .method-text { align-self: center; padding: 60px var(--gutter); }
  .final-grid { grid-template-columns: 1fr 1fr; gap: 20px 72px; align-items: start; }
  .source { grid-column: 2; }
  .bio-grid { grid-template-columns: 5fr 7fr; gap: 64px; align-items: start; }
  .bio figure { position: sticky; top: 96px; }
  .blog-home { padding-bottom: 84px; }
  .contact-grid { grid-template-columns: 7fr 4fr; gap: 72px; }
  form .btn { width: auto; justify-self: start; }
}

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