/* ============================================
   BARTEKARPETA TATTOO — ENCRE VIVE
   Design Tokens + Custom Styles
   ============================================ */

/* --- PRIMITIVES --- */
:root {
  --p-ink: #0C0C10;
  --p-surface: #18191F;
  --p-red-600: #C42830;
  --p-gray-500: #8A8D96; /* Brief: #6B6E76 — élevé délibérément pour respecter WCAG AA 4.5:1 sur fond ink */
  --p-white-warm: #E8E6E1;
  --p-white-flash: #F5F4F0;

  --p-font-heading: 'Space Grotesk', system-ui, sans-serif;
  --p-font-body: 'DM Sans', system-ui, sans-serif;
  --p-font-accent: 'Caveat', cursive;

  --p-space-unit: 4px;
  --p-radius-sm: 4px;
  --p-radius-md: 8px;

  --p-shadow-card: 0 4px 12px rgba(12,12,16,0.4);
  --p-shadow-lift: 0 8px 24px rgba(12,12,16,0.6);

  --p-duration-fast: 150ms;
  --p-duration-base: 300ms;
  --p-duration-needle: 400ms;
  --p-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- SEMANTICS --- */
:root {
  --color-bg: var(--p-ink);
  --color-surface: var(--p-surface);
  --color-accent: var(--p-red-600);
  --color-text: var(--p-white-warm);
  --color-text-emphasis: var(--p-white-flash);
  --color-muted: var(--p-gray-500);

  --font-heading: var(--p-font-heading);
  --font-body: var(--p-font-body);
  --font-accent: var(--p-font-accent);
}

/* --- COMPONENT TOKENS --- */
:root {
  --btn-primary-bg: var(--color-accent);
  --btn-primary-text: var(--color-text-emphasis);
  --btn-outline-border: var(--color-text-emphasis);

  --card-bg: var(--color-surface);
  --card-shadow: var(--p-shadow-card);
  --card-hover-shadow: var(--p-shadow-lift);

  --nav-bg: transparent;
  --nav-text: var(--color-text-emphasis);

  --needle-line-color: var(--color-accent);
  --needle-line-width: 2px;
  --needle-line-duration: var(--p-duration-needle);

  --testimonial-quote-color: var(--color-accent);
  --testimonial-bg: var(--color-surface);

  --filter-active-border: var(--color-accent);
  --filter-inactive-text: var(--color-muted);
}

/* --- RESET & BASE --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-text-emphasis);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.font-accent {
  font-family: var(--font-accent);
  font-weight: 700;
}

/* --- NAVIGATION --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color var(--p-duration-base) var(--p-ease-out),
              box-shadow var(--p-duration-base) var(--p-ease-out);
}

.nav.scrolled {
  background-color: rgba(12, 12, 16, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(107, 110, 118, 0.15);
}

.nav__logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text-emphasis);
  letter-spacing: -0.03em;
}

.nav__logo span {
  color: var(--color-accent);
}

.nav__burger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  z-index: 110;
}

.nav__burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text-emphasis);
  transition: transform var(--p-duration-base) var(--p-ease-out),
              opacity var(--p-duration-fast);
}

.nav__burger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav__burger.open span:nth-child(2) {
  opacity: 0;
}
.nav__burger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav__menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(320px, 85vw);
  height: 100dvh;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 48px;
  gap: 32px;
  transition: right var(--p-duration-base) var(--p-ease-out);
  z-index: 105;
  border-left: 1px solid rgba(107, 110, 118, 0.15);
}

.nav__menu.open {
  right: 0;
}

.nav__overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 12, 16, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--p-duration-base);
  z-index: 102;
}

.nav__overlay.open {
  opacity: 1;
  pointer-events: all;
}

.nav__link {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--color-text);
  position: relative;
  transition: color var(--p-duration-fast);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--p-duration-needle) var(--p-ease-out);
}

.nav__link:hover,
.nav__link:focus-visible {
  color: var(--color-text-emphasis);
}

.nav__link:hover::after,
.nav__link:focus-visible::after {
  width: 100%;
}

.nav__cta-desktop {
  display: none;
}

@media (min-width: 768px) {
  .nav {
    padding: 20px 48px;
  }
  .nav__cta-desktop {
    display: inline-flex;
  }
  .nav__burger {
    display: none;
  }
  .nav__menu {
    position: static;
    width: auto;
    height: auto;
    background: none;
    flex-direction: row;
    padding: 0;
    gap: 32px;
    border: none;
    align-items: center;
  }
  .nav__link {
    font-size: 0.875rem;
    font-weight: 500;
  }
  .nav__overlay {
    display: none;
  }
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: var(--p-radius-sm);
  transition: transform var(--p-duration-fast) var(--p-ease-out),
              box-shadow var(--p-duration-base) var(--p-ease-out),
              background-color var(--p-duration-fast),
              border-color var(--p-duration-fast);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.btn--primary {
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}

.btn--primary:hover {
  background-color: #a82228;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(196, 40, 48, 0.35);
}

.btn--outline {
  background: transparent;
  border: 2px solid var(--btn-outline-border);
  color: var(--color-text-emphasis);
}

.btn--outline:hover {
  background: rgba(245, 244, 240, 0.06);
  transform: translateY(-1px);
}

.btn--sm {
  padding: 10px 20px;
  font-size: 0.8125rem;
}

/* --- HERO --- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 96px 24px 64px;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(12, 12, 16, 0.2) 0%,
    rgba(12, 12, 16, 0.4) 40%,
    rgba(12, 12, 16, 0.85) 100%
  );
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero__title {
  font-size: clamp(3rem, 8vw, 7rem);
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin-bottom: 16px;
}

.hero__subtitle {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--color-muted);
  margin-bottom: 40px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero__scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--color-muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero__scroll svg {
  animation: pulse-down 2s ease-in-out infinite;
}

@keyframes pulse-down {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(8px); opacity: 1; }
}

@media (min-width: 768px) {
  .hero {
    padding: 96px 80px 96px;
  }
}

/* --- SECTIONS COMMON --- */
.section {
  padding: 80px 24px;
  position: relative;
}

.section--surface {
  background-color: var(--color-surface);
}

.section__label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 16px;
}

.section__title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 48px;
  letter-spacing: -0.03em;
}

@media (min-width: 768px) {
  .section {
    padding: 120px 80px;
  }
}

/* --- FADE IN ANIMATION --- */
.fade-in {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--p-ease-out), transform 0.7s var(--p-ease-out);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero__scroll svg {
    animation: none;
  }
  .gallery__item::before {
    transition: none !important;
  }
}

/* --- GALLERY --- */
.gallery__filters {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.gallery__filter {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--filter-inactive-text);
  padding: 8px 0;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color var(--p-duration-fast);
}

.gallery__filter::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--filter-active-border);
  transition: width var(--p-duration-needle) var(--p-ease-out);
}

.gallery__filter.active,
.gallery__filter:hover {
  color: var(--color-text-emphasis);
}

.gallery__filter.active::after {
  width: 100%;
}

.gallery__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (min-width: 1024px) {
  .gallery__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

/* Masonry spans */
@media (min-width: 640px) {
  .gallery__item--wide {
    grid-column: span 2;
  }
  .gallery__item--tall {
    grid-row: span 2;
  }
}

.gallery__item {
  position: relative;
  border-radius: var(--p-radius-md);
  overflow: hidden;
  cursor: pointer;
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--p-duration-needle) var(--p-ease-out);
  aspect-ratio: 4/5;
}

.gallery__item--wide img {
  aspect-ratio: 16/10;
}

/* NEEDLE-LINE signature interaction */
.gallery__item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: var(--needle-line-width);
  height: 100%;
  background: var(--needle-line-color);
  z-index: 3;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--needle-line-duration) var(--p-ease-out);
}

.gallery__item:hover::before,
.gallery__item:focus-within::before {
  transform: scaleY(1);
}

.gallery__item:hover img,
.gallery__item:focus-within img {
  transform: scale(1.03);
}

.gallery__item:hover {
  box-shadow: var(--card-hover-shadow);
}

.gallery__item {
  transition: opacity 300ms var(--p-ease-out), transform 300ms var(--p-ease-out);
}

.gallery__item--hidden {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

/* Shimmer placeholder */
.gallery__item .shimmer {
  position: absolute;
  inset: 0;
  background: var(--color-surface);
  z-index: 1;
}

.gallery__item .shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(107, 110, 118, 0.08) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.gallery__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 48px;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--color-text);
  position: relative;
  transition: color var(--p-duration-fast);
}

.gallery__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--p-duration-needle) var(--p-ease-out);
}

.gallery__link:hover {
  color: var(--color-text-emphasis);
}

.gallery__link:hover::after {
  width: 100%;
}

/* --- ARTISTS --- */
.artist {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-bottom: 80px;
}

.artist:last-child {
  margin-bottom: 0;
}

.artist__photo {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: var(--p-radius-md);
  overflow: hidden;
}

.artist__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.3);
  transition: filter var(--p-duration-base);
}

.artist:hover .artist__photo img {
  filter: saturate(0.6);
}

.artist__info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.artist__name {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 4px;
}

.artist__signature {
  font-family: var(--font-accent);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--color-accent);
  margin-bottom: 24px;
}

.artist__bio {
  color: var(--color-text);
  margin-bottom: 24px;
  max-width: 500px;
  line-height: 1.7;
}

.artist__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.artist__tag {
  background: var(--color-surface);
  color: var(--color-text);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 500;
}

.artist__cta {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  transition: color var(--p-duration-fast);
}

.artist__cta::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--p-duration-needle) var(--p-ease-out);
}

.artist__cta:hover {
  color: var(--color-text-emphasis);
}

.artist__cta:hover::after {
  width: 100%;
}

@media (min-width: 768px) {
  .artist {
    flex-direction: row;
    gap: 64px;
    align-items: stretch;
  }

  .artist--reverse {
    flex-direction: row-reverse;
  }

  .artist__photo {
    width: 50%;
    flex-shrink: 0;
    aspect-ratio: auto;
    min-height: 500px;
  }

  .artist__info {
    width: 50%;
    padding: 48px 0;
  }
}

/* --- TESTIMONIALS --- */
.testimonials__badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
}

.testimonials__score {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2.5rem, 5vw, 4rem);
  color: var(--color-text-emphasis);
}

.testimonials__meta {
  color: var(--color-muted);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.testimonials__stars {
  color: #F5C518;
  font-size: 1.25rem;
  letter-spacing: 2px;
}

.testimonials__track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 16px;
  scrollbar-width: none;
}

.testimonials__track::-webkit-scrollbar {
  display: none;
}

.testimonial-card {
  flex: 0 0 min(360px, 85vw);
  scroll-snap-align: start;
  background: var(--color-bg);
  border-radius: var(--p-radius-md);
  padding: 32px;
  position: relative;
  border-left: 2px solid transparent;
  transition: border-color var(--p-duration-base);
}

.testimonial-card:hover {
  border-left-color: var(--color-accent);
}

.testimonial-card__quote {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: 16px;
}

.testimonial-card__text {
  color: var(--color-text);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 24px;
  font-style: italic;
}

.testimonial-card__author {
  color: var(--color-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- STUDIO --- */
.studio__hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--p-radius-md);
  overflow: hidden;
  margin-bottom: 48px;
}

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

.studio__hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--color-bg) 0%, transparent 60%);
}

.studio__info {
  max-width: 600px;
}

.studio__address {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  color: var(--color-text-emphasis);
  margin-bottom: 8px;
}

.studio__quarter {
  color: var(--color-muted);
  font-size: 0.9375rem;
  margin-bottom: 32px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.studio__map {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--p-radius-md);
  overflow: hidden;
  border: 1px solid rgba(107, 110, 118, 0.15);
  filter: grayscale(1) contrast(1.1) brightness(0.7);
  transition: filter var(--p-duration-base);
}

.studio__map:hover {
  filter: grayscale(0.5) contrast(1) brightness(0.8);
}

.studio__map iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.studio__hours {
  margin-top: 32px;
  color: var(--color-muted);
  font-size: 0.875rem;
}

/* --- CONTACT --- */
.contact {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 60dvh;
  justify-content: center;
}

.contact__title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  margin-bottom: 48px;
  letter-spacing: -0.03em;
}

.contact__buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 48px;
  width: 100%;
  max-width: 460px;
}

@media (min-width: 640px) {
  .contact__buttons {
    flex-direction: row;
    justify-content: center;
  }
}

.contact__socials {
  display: flex;
  gap: 24px;
  margin-bottom: 64px;
}

.contact__social {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  transition: background var(--p-duration-fast), color var(--p-duration-fast), transform var(--p-duration-fast);
}

.contact__social:hover {
  background: var(--color-accent);
  color: var(--color-text-emphasis);
  transform: translateY(-2px);
}

.contact__social svg {
  width: 20px;
  height: 20px;
}

.contact__legal {
  color: var(--color-muted);
  font-size: 0.75rem;
}

/* --- MOBILE STICKY CTA --- */
.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  padding: 12px 24px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(12, 12, 16, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(107, 110, 118, 0.15);
  display: flex;
  justify-content: center;
  transform: translateY(100%);
  transition: transform var(--p-duration-base) var(--p-ease-out);
}

.sticky-cta.visible {
  transform: translateY(0);
}

.sticky-cta .btn {
  width: 100%;
  max-width: 400px;
}

@media (min-width: 768px) {
  .sticky-cta {
    display: none;
  }
}

/* --- LIGHTBOX --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(12, 12, 16, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--p-duration-base);
}

.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--p-radius-sm);
}

.lightbox__close {
  position: absolute;
  top: 24px;
  right: 24px;
  color: var(--color-text-emphasis);
  font-size: 2rem;
  padding: 8px;
  line-height: 1;
}

/* --- UTILITIES --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
}

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