/* Tramuntana Digital · estil "Mediterrani"
   Paleta i tipografia documentades a DESIGN.md. Tots els colors surten dels tokens. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("../fonts/figtree-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f5f9fc;
  --surface: #ffffff;
  --ink: #0b3b5c;
  --text: #0c2a40;
  --muted: #3d5a70;
  --line: #d6e5f0;
  --sea: #18649a;
  --sea-soft: #e4f0f8;
  --btn-bg: #0b3b5c;
  --btn-fg: #f5f9fc;
  --card-ink: #0b3b5c;
  --card-ink-fg: #f5f9fc;
  --card-ink-muted: #b9d4e7;
  --sky-1: #cfe6f5;
  --sky-2: #8fc1e3;
  --sea-1: #1a6aa3;
  --sea-2: #0b3b5c;
  --gust: #f5f9fc;
  --ok: #1d7a4f;
  --err: #b42318;
  --shadow: 0 1px 2px rgb(11 59 92 / 0.06), 0 12px 32px -12px rgb(11 59 92 / 0.18);

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 18px;
  --radius-sm: 10px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(64px, 9vw, 120px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #08151f;
    --surface: #0f2231;
    --ink: #e6f0f7;
    --text: #d6e4ee;
    --muted: #9fb6c7;
    --line: #1d3649;
    --sea: #74b9e8;
    --sea-soft: #12293b;
    --btn-bg: #74b9e8;
    --btn-fg: #06121b;
    --card-ink: #12304a;
    --card-ink-fg: #e6f0f7;
    --card-ink-muted: #a9c6dc;
    --sky-1: #1b4466;
    --sky-2: #1f5f8f;
    --sea-1: #164f78;
    --sea-2: #0a2a42;
    --gust: #d9ebf7;
    --ok: #5cc790;
    --err: #ff8a7a;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 32px -12px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #08151f;
  --surface: #0f2231;
  --ink: #e6f0f7;
  --text: #d6e4ee;
  --muted: #9fb6c7;
  --line: #1d3649;
  --sea: #74b9e8;
  --sea-soft: #12293b;
  --btn-bg: #74b9e8;
  --btn-fg: #06121b;
  --card-ink: #12304a;
  --card-ink-fg: #e6f0f7;
  --card-ink-muted: #a9c6dc;
  --sky-1: #1b4466;
  --sky-2: #1f5f8f;
  --sea-1: #164f78;
  --sea-2: #0a2a42;
  --gust: #d9ebf7;
  --ok: #5cc790;
  --err: #ff8a7a;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 32px -12px rgb(0 0 0 / 0.5);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--sea); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--sea); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 5.6vw, 4.25rem); line-height: 1.04; letter-spacing: -0.03em; font-weight: 700; }
h2 { font-size: clamp(2rem, 3.6vw, 2.9rem); line-height: 1.08; letter-spacing: -0.025em; font-weight: 700; }
h3 { font-size: 1.2rem; line-height: 1.3; letter-spacing: -0.01em; font-weight: 650; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }
.section-head { display: grid; gap: 14px; max-width: 62ch; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head p { color: var(--muted); font-size: 1.125rem; }
.eyebrow { font-size: 0.8rem; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sea); }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--btn-bg); color: var(--btn-fg); padding: 10px 16px; border-radius: var(--radius-sm);
}
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + 12px); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px;
  font: 600 1rem/1.2 var(--font-body); text-decoration: none; white-space: nowrap;
  background: var(--btn-bg); color: var(--btn-fg); border: 0; cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--sea); }
.btn--sm { min-height: 42px; padding: 10px 18px; font-size: 0.95rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-row { display: flex; align-items: center; gap: 20px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; white-space: nowrap; }
.brand img { width: 36px; height: 36px; }
.brand span span { color: var(--sea); }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a { color: var(--text); text-decoration: none; font-weight: 500; font-size: 0.98rem; padding: 8px 12px; border-radius: 999px; }
.nav a:hover { background: var(--sea-soft); }
.lang { display: inline-flex; align-items: center; gap: 2px; font-size: 0.85rem; font-weight: 650; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang a, .lang span { padding: 4px 9px; border-radius: 999px; text-decoration: none; color: var(--muted); }
.lang [aria-current="true"] { background: var(--ink); color: var(--bg); }
.menu { display: none; position: relative; margin-left: auto; }
.menu summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); font-weight: 600; color: var(--ink);
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary .bars { width: 18px; height: 12px; position: relative; }
.menu summary .bars::before, .menu summary .bars::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: currentColor; border-radius: 2px; }
.menu summary .bars::before { top: 1px; }
.menu summary .bars::after { bottom: 1px; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); width: min(300px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 10px; display: grid; gap: 2px;
}
.menu-panel a { color: var(--text); text-decoration: none; padding: 12px 14px; border-radius: var(--radius-sm); font-weight: 550; }
.menu-panel a:hover { background: var(--sea-soft); }
.menu-panel .btn { margin-top: 6px; color: var(--btn-fg); }
.menu-panel .lang { margin: 8px 6px 4px; align-self: start; justify-self: start; }

@media (max-width: 960px) {
  .nav { display: none; }
  .header-cta { display: none; }
  .header-lang { display: none; }
  .menu { display: block; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(40px, 7vw, 88px) clamp(56px, 8vw, 104px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-copy { display: grid; gap: 22px; min-width: 0; }
.hero h1 em { font-style: normal; color: var(--sea); }
.hero-lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--muted); max-width: 40ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.sea {
  position: relative; aspect-ratio: 4 / 5; max-width: 100%; border-radius: 28px; overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 46%, var(--sea-1) 46.2%, var(--sea-2) 100%);
}
.sea svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sea .gust { fill: none; stroke: var(--gust); stroke-width: 2.6; stroke-linecap: round; opacity: 0.75; }
.sea .wave { fill: none; stroke: rgb(255 255 255 / 0.16); stroke-width: 2; }
.sea-tag { position: absolute; left: 24px; right: 24px; bottom: 24px; color: #f5f9fc; display: grid; gap: 4px; }
.sea-tag strong { font-family: var(--font-display); font-size: clamp(1.6rem, 2.6vw, 2.1rem); letter-spacing: -0.02em; line-height: 1; }
.sea-tag span { font-size: 1rem; opacity: 0.92; max-width: 28ch; }

@media (prefers-reduced-motion: no-preference) {
  .sea .gust { stroke-dasharray: 1; stroke-dashoffset: 1; animation: gust-in 1.6s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards; }
  .sea .gust:nth-of-type(2) { animation-delay: 0.3s; }
  .sea .gust:nth-of-type(3) { animation-delay: 0.45s; }
}
@keyframes gust-in { to { stroke-dashoffset: 0; } }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .sea { aspect-ratio: 16 / 10; }
  .sea .gust { stroke-width: 4.6; }
  .sea .wave { stroke-width: 3.4; }
}

/* ---------- Services ---------- */
.services-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(8px, 2vw, 16px) clamp(20px, 3.4vw, 40px); }
.price-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(32px, 5vw, 64px); margin: 0; padding: 0; list-style: none; }
.price-row { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding-block: 22px; border-bottom: 1px solid var(--line); }
.price-row:nth-last-child(-n+1) { border-bottom: 0; }
.price-row h3 { font-size: 1.15rem; }
.price-row p { color: var(--muted); font-size: 0.98rem; margin-top: 4px; max-width: 42ch; }
.price { font-family: var(--font-display); font-weight: 700; color: var(--sea); white-space: nowrap; font-size: 1.35rem; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.price small { font-family: var(--font-body); font-size: 0.8rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.extras { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 32px; align-items: center; padding: 22px clamp(20px, 3.4vw, 40px); border-radius: var(--radius); background: var(--sea-soft); }
.extras h3 { margin-bottom: 8px; }
.extras ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.extras li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 0.93rem; }
.extras .price { font-size: 1.1rem; }
.vat { margin-top: 14px; color: var(--muted); font-size: 0.9rem; }
@media (max-width: 860px) {
  .price-list { grid-template-columns: 1fr; }
  .price-row:nth-last-child(-n+1) { border-bottom: 0; }
  .extras { grid-template-columns: 1fr; }
}
@media (min-width: 861px) {
  .price-row:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
}
@media (max-width: 520px) {
  .price-row { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ---------- Work ---------- */
.work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.work-card { border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); display: grid; grid-template-rows: auto 1fr; }
.work-art { aspect-ratio: 4 / 3; display: grid; place-items: end start; padding: 22px; color: #f5f9fc; position: relative; overflow: hidden; }
.work-art strong { font-family: var(--font-display); font-size: clamp(1.4rem, 2.2vw, 1.8rem); line-height: 1.05; letter-spacing: -0.02em; position: relative; }
.work-art::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 80% at 100% 0%, rgb(255 255 255 / 0.22), transparent 60%); }
.work-art--restaurant { background: linear-gradient(150deg, #1f7ab8, #0b3b5c); }
.work-art--barberia { background: linear-gradient(150deg, #123a57, #061826); }
.work-art--fisio { background: linear-gradient(150deg, #5aa6d6, #1f6a9e); }
.work-body { padding: 20px 22px 22px; display: grid; gap: 10px; align-content: start; }
.work-body p { color: var(--muted); }
.badge { justify-self: start; font-size: 0.82rem; font-weight: 650; color: var(--sea); background: var(--sea-soft); border-radius: 999px; padding: 4px 12px; }
.work-body a.badge { text-decoration: none; }
@media (max-width: 900px) { .work-grid { grid-template-columns: 1fr; } .work-art { aspect-ratio: 16 / 7; } }

/* ---------- Why (bento) ---------- */
.why-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.why-item { grid-column: span 2; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: grid; gap: 10px; align-content: start; }
.why-item p { color: var(--muted); }
.why-item:nth-child(1) { grid-column: span 3; background: linear-gradient(160deg, var(--sea-1), var(--sea-2)); border-color: transparent; color: #f5f9fc; min-height: 220px; align-content: end; }
.why-item:nth-child(1) h3 { color: #ffffff; font-size: 1.6rem; }
.why-item:nth-child(1) p { color: #d9eaf6; font-size: 1.05rem; max-width: 38ch; }
.why-item:nth-child(2) { grid-column: span 3; background: var(--sea-soft); border-color: transparent; align-content: end; }
.why-item:nth-child(2) h3 { font-size: 1.6rem; }
@media (max-width: 900px) {
  .why-grid { grid-template-columns: 1fr 1fr; }
  .why-item, .why-item:nth-child(1), .why-item:nth-child(2) { grid-column: span 1; }
  .why-item:nth-child(1) { grid-column: 1 / -1; min-height: 180px; }
}
@media (max-width: 560px) { .why-grid { grid-template-columns: 1fr; } .why-item { grid-column: 1 / -1 !important; } }

/* ---------- Process ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; counter-reset: step; position: relative; }
.steps::before { content: ""; position: absolute; left: 22px; right: 22px; top: 22px; height: 2px; background: var(--line); }
.step { position: relative; display: grid; gap: 10px; align-content: start; counter-increment: step; }
.step::before {
  content: counter(step); width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--btn-fg); background: var(--btn-bg);
  box-shadow: 0 0 0 6px var(--bg); position: relative; margin-bottom: 8px;
}
.step p { color: var(--muted); }
@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr; gap: 26px; }
  .steps::before { left: 22px; right: auto; top: 22px; bottom: 22px; width: 2px; height: auto; }
  .step { grid-template-columns: 46px 1fr; column-gap: 18px; }
  .step::before { grid-row: span 2; margin-bottom: 0; }
}

/* ---------- FAQ ---------- */
.faq-list { display: grid; gap: 10px; max-width: 820px; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.faq-item summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 22px; font-weight: 600; color: var(--ink); font-size: 1.05rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; flex: none; width: 12px; height: 12px; border-right: 2px solid var(--sea); border-bottom: 2px solid var(--sea);
  transform: rotate(45deg) translate(-2px, -2px); transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.faq-item p { padding: 0 22px 20px; color: var(--muted); max-width: 70ch; }

/* ---------- Contact ---------- */
.contact-card { background: var(--card-ink); color: var(--card-ink-fg); border-radius: 28px; padding: clamp(28px, 5vw, 64px); display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 64px); }
.contact-card h2 { color: var(--card-ink-fg); }
.contact-intro { display: grid; gap: 18px; align-content: start; }
.contact-intro > p { color: var(--card-ink-muted); font-size: 1.1rem; }
.direct { display: grid; gap: 8px; margin-top: 12px; padding-top: 20px; border-top: 1px solid rgb(255 255 255 / 0.16); }
.direct span { color: var(--card-ink-muted); font-size: 0.95rem; }
.direct a { color: var(--card-ink-fg); font-weight: 600; font-size: 1.15rem; word-break: break-all; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; background: var(--surface); color: var(--text); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); }
.field { display: grid; gap: 6px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 0.95rem; color: var(--ink); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; min-height: 48px;
}
.field textarea { min-height: 128px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 0.85; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--sea); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sea) 25%, transparent); }
.field [aria-invalid="true"] { border-color: var(--err); }
.check { grid-column: 1 / -1; display: flex; gap: 12px; align-items: flex-start; font-size: 0.95rem; color: var(--muted); }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--sea); }
.form-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.form-status { font-weight: 600; font-size: 0.95rem; }
.form-status[data-state="ok"] { color: var(--ok); }
.form-status[data-state="error"] { color: var(--err); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 900px) { .contact-card { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .form { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 48px calc(40px + env(safe-area-inset-bottom, 0px)); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 32px; align-items: start; }
.footer-grid p { color: var(--muted); margin-top: 12px; max-width: 36ch; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-links a { color: var(--text); text-decoration: none; }
.footer-links a:hover { color: var(--sea); text-decoration: underline; }
.footer-meta { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 0.9rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Legal pages ---------- */
.prose { max-width: 72ch; padding-block: clamp(40px, 7vw, 80px); }
.prose h1 { font-size: clamp(2.2rem, 4.6vw, 3.2rem); margin-bottom: 10px; }
.prose .updated { color: var(--muted); margin-bottom: 36px; }
.prose h2 { font-size: 1.4rem; margin: 36px 0 12px; letter-spacing: -0.015em; }
.prose p, .prose li { color: var(--text); }
.prose p + p { margin-top: 12px; }
.prose ul { padding-left: 1.2em; display: grid; gap: 6px; margin: 12px 0; }
.prose code { font-size: 0.9em; background: var(--sea-soft); padding: 1px 6px; border-radius: 6px; }
.prose .back { margin-top: 44px; }
.pending { background: #fff3c4; color: #5c4400; padding: 0 4px; border-radius: 4px; }

/* ---------- 404 ---------- */
.not-found { min-height: 60vh; display: grid; place-content: center; text-align: center; gap: 18px; padding-block: 64px; }
.not-found p { color: var(--muted); }
.not-found .btn { justify-self: center; }
