/* Design tokens from Figma — NP Events portfolio */
:root {
  --color-accent: #650934;
  --color-primary: #e45050;
  --color-primary-highlight: #f26c6b;
  --color-secondary: #4a7389;
  --color-text: #000000;
  --color-muted: #4b4b4b;
  --color-dark: #232323;
  --color-white: #ffffff;
  --font-sans: "Lato", system-ui, sans-serif;
  --font-display: "Playfair Display", Georgia, serif;
  --radius-pill: 100px;
  --radius-card: 16px;
  --shadow-btn: 0 4px 4px rgba(0, 0, 0, 0.25);
  /* Center column width — widens on tablet/desktop for portfolio presentation */
  --layout-max-width: min(100%, 402px);
  --carousel-slide-max: 355px;
  /* Mobile: narrow photo strip; tablet+ overrides to full-bleed */
  --hero-photo-max: 347px;
  --hero-min-height: 205px;
  /* Horizontal scroll hint: next slide peeks beside the current one */
  --carousel-peek: 24px;
  --carousel-img-max-height: 473px;
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-white);
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--color-accent);
  color: var(--color-white);
  text-decoration: none;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

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

/* —— Header —— */

@keyframes header-fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes header-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.site-header {
  padding: 22px 23px 0;
  text-align: center;
  max-width: 100%;
}

.brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 40px;
  max-width: 40px;
  height: auto;
  object-fit: contain;
  animation: header-fade-up 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.brand-name {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(1.75rem, 5vw, 2rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-accent);
  line-height: 1.2;
  animation: header-fade-up 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) 0.12s both;
}

/* Width for JS: largest font that keeps tagline on one line */
.tagline-wrap {
  width: 100%;
  max-width: 100%;
  padding: 20px 0 16px;
  overflow: hidden;
  text-align: center;
}

.tagline {
  margin: 0;
  padding: 0;
  display: inline-block;
  font-family: var(--font-display);
  font-size: 16px; /* fallback before JS; overridden for fit */
  font-weight: 700;
  color: var(--color-primary);
  line-height: normal;
  white-space: nowrap;
  animation: header-fade-in 0.7s ease-out 0.28s both;
}

/* —— Hero ——
   Photo uses intrinsic height (no object-fit: cover) so the image is never cropped when scaling.
   Gradient + copy are absolutely layered; hero height follows the image + min-height floor. */

@keyframes hero-photo-drift {
  from { transform: scale(1); }
  to   { transform: scale(1.05); }
}

@keyframes hero-copy-in {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.hero {
  position: relative;
  min-height: var(--hero-min-height);
  overflow: hidden;
  background: var(--color-accent);
}

.hero__media {
  position: relative;
  z-index: 0;
  width: min(86.3%, var(--hero-photo-max));
}

.hero__photo {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: center center;
  animation: hero-photo-drift 10s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Opaque at the right (text); fade begins further right so more floral shows on the left */
.hero__gradient {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to left,
    rgb(101, 9, 52) 0%,
    rgb(101, 9, 52) 22%,
    rgba(101, 9, 52, 0.58) 44%,
    rgba(101, 9, 52, 0.14) 68%,
    rgba(101, 9, 52, 0) 100%
  );
  pointer-events: none;
}

.hero__copy {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  z-index: 2;
  width: 66.5%;
  max-width: 268px;
  padding: 1.9rem 1.45rem 1.9rem 0.5rem;
  display: flex;
  align-items: center;
  animation: hero-copy-in 0.75s cubic-bezier(0.22, 0.61, 0.36, 1) 0.3s both;
}

.hero__copy p {
  margin: 0;
  /* Scales with viewport — stays in proportion to taller hero bands on tablet/desktop */
  font-size: clamp(1rem, 0.8rem + 0.55vw, 1.4375rem);
  font-weight: 600;
  line-height: clamp(1.45, 1.52, 1.65);
  color: var(--color-white);
  text-align: right;
}

.hero__copy strong {
  font-weight: 600;
}

.hero__comma {
  font-weight: 400;
}

/* —— CTA —— */
.cta-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 4.5rem 23px 3rem;
  text-align: center;
}

.cta-block--closing {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
  /* Explicit centering (matches first CTA); avoids left drift from flex defaults or cached CSS */
  align-items: center;
  text-align: center;
}

.cta-block__text {
  text-align: center;
  width: 100%;
}

.cta-block__lead {
  margin: 0 0 0.25rem;
  font-size: 20px;
  font-style: italic;
  font-weight: 600;
  color: var(--color-primary-highlight);
  line-height: 24px;
}

.cta-block__sub {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  line-height: 26px;
  text-wrap: balance;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 400;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: var(--shadow-btn);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.btn--primary:active {
  transform: scale(0.96);
  box-shadow: var(--shadow-btn);
  transition-duration: 0.08s;
}

.btn__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

/* —— Scroll reveals —— */

@keyframes tray-rise {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes category-surface {
  from { transform: translateY(10px); }
  to   { transform: translateY(0); }
}

/* Scoped to no-preference so content stays visible without JS or for reduced-motion users */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    opacity: 0;
  }

  [data-reveal].is-visible {
    animation: tray-rise 0.65s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }

  .section-title[data-reveal].is-visible {
    animation-duration: 0.5s;
  }

  /* Category label nudges up slightly after the tray body has started rising */
  .project.is-visible .project__category {
    animation: category-surface 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) 0.15s both;
  }
}

/* —— Portfolio —— */
.portfolio {
  padding: 1rem 23px 3.5rem;
  max-width: var(--layout-max-width);
  margin-inline: auto;
}

.section-title {
  margin: 0 0 2rem;
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 4vw, 1.5rem);
  font-weight: 700;
  font-style: normal;
  text-transform: none;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: var(--color-secondary);
}

.project {
  margin-bottom: 3.75rem;
}

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

.project__category {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 3.2vw, 1.25rem);
  font-weight: 700;
  font-style: normal;
  color: var(--color-accent);
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.project__block--spaced {
  margin-top: 2.5rem;
}

.project__meta {
  margin-bottom: 0.5rem;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 22px;
}

.project__meta--accent {
  color: var(--color-primary-highlight);
}

.project__meta p {
  margin: 0 0 0.15rem;
}

.project__meta .label {
  font-weight: 700;
}

.project__description {
  margin: 0 0 1.25rem;
  font-size: 16px;
  line-height: 24px;
  color: var(--color-muted);
}

.project__description p {
  margin: 0 0 0.75rem;
}

.project__description p:last-child {
  margin-bottom: 0;
}

.project__description em {
  font-style: italic;
  font-weight: 700;
}

.project__description--compact {
  color: var(--color-dark);
}

.project__description--compact em {
  font-style: italic;
  font-weight: 700;
}

/* —— Carousel —— */
.carousel {
  position: relative;
  margin: 0 -23px 0 0;
  padding-right: 23px;
}

.carousel__track {
  display: flex;
  width: 100%;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
  scroll-padding-inline: 0;
  /* Light edge feather only (no white overlay): mask fades the last few px into the page */
  -webkit-mask-image: linear-gradient(
    to right,
    #000 0,
    #000 calc(100% - 10px),
    rgba(0, 0, 0, 0.45) calc(100% - 4px),
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    #000 0,
    #000 calc(100% - 10px),
    rgba(0, 0, 0, 0.45) calc(100% - 4px),
    transparent 100%
  );
}

/* No next-slide sliver at the end — drop the right-edge feather */
.carousel--at-end .carousel__track {
  -webkit-mask-image: none;
  mask-image: none;
}

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

.carousel__slide {
  /* Narrow columns: slide is track width minus peek so a sliver of the next image shows */
  flex: 0 0 min(calc(100% - var(--carousel-peek)), var(--carousel-slide-max));
  width: min(calc(100% - var(--carousel-peek)), var(--carousel-slide-max));
  margin: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.carousel__slide img {
  display: block;
  width: 100%;
  height: min(70vh, var(--carousel-img-max-height));
  object-fit: cover;
  border-radius: var(--radius-card);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
  min-height: 8px;
}

.carousel__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(74, 115, 137, 0.35);
  transition: background 0.2s ease, transform 0.2s ease;
}

.carousel__dot.is-active {
  background: var(--color-secondary);
  transform: scale(1.15);
}

/* —— Scroll to top —— */
.scroll-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.15s ease;
}

.scroll-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
  transform: translateY(-2px);
}

.scroll-top:active {
  transform: scale(0.93);
  transition-duration: 0.08s;
}

/* —— Footer —— */

@keyframes footer-slide-in {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.site-footer {
  background: var(--color-secondary);
  padding: 20px 23px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 16px 8px;
  align-items: start;
  max-width: 20rem;
}

/* Each row is 2 grid children (icon + content). Rows 1, 2, 3 → nth-child pairs 1-2, 3-4, 5-6 */
.site-footer.is-visible .contact-grid > :nth-child(1),
.site-footer.is-visible .contact-grid > :nth-child(2) {
  animation: footer-slide-in 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.site-footer.is-visible .contact-grid > :nth-child(3),
.site-footer.is-visible .contact-grid > :nth-child(4) {
  animation: footer-slide-in 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) 0.1s both;
}

.site-footer.is-visible .contact-grid > :nth-child(5),
.site-footer.is-visible .contact-grid > :nth-child(6) {
  animation: footer-slide-in 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) 0.2s both;
}

.contact-grid__icon {
  margin-top: 2px;
}

/* WhatsApp mark reads larger at 24px; scale down for parity with envelope & location */
.contact-grid__icon--whatsapp {
  width: 20px;
  height: 20px;
  justify-self: center;
  margin-top: 4px;
}

.contact-grid__link,
.contact-grid__text {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-white);
  line-height: 1.35;
}

.contact-grid__link {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.contact-grid__link:hover {
  opacity: 0.92;
}

.footer-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 20px 23px 24px;
  max-width: var(--layout-max-width);
  margin-inline: auto;
}

.footer-brand img {
  width: 40px;
  max-width: 40px;
  height: auto;
}

/* —— Tablet / desktop: wider column, larger hero & carousel for monitor viewing —— */
@media (min-width: 480px) {
  :root {
    --layout-max-width: min(100% - 2rem, 40rem);
    --carousel-slide-max: 420px;
    --carousel-img-max-height: 500px;
    /* Min height when image is short; hero height is max(this, intrinsic image height) */
    --hero-min-height: clamp(240px, 38vw, 500px);
  }

  .site-header,
  .hero,
  .cta-block,
  .portfolio,
  .site-footer,
  .footer-brand {
    max-width: var(--layout-max-width);
    margin-inline: auto;
  }

  /* Full-bleed photo + gradient overlay — no hard vertical split with solid panel */
  .hero__media {
    width: 100%;
  }

  .hero__gradient {
    background: linear-gradient(
      to left,
      rgb(101, 9, 52) 0%,
      rgb(101, 9, 52) 6%,
      rgba(101, 9, 52, 0.94) 18%,
      rgba(101, 9, 52, 0.72) 34%,
      rgba(101, 9, 52, 0.38) 52%,
      rgba(101, 9, 52, 0.12) 72%,
      rgba(101, 9, 52, 0) 100%
    );
  }

  .hero__copy {
    max-width: min(44%, 22rem);
    width: 48%;
    padding: 2rem 1.5rem 2rem 0.75rem;
  }

  .carousel {
    margin-right: 0;
    padding-right: 0;
  }
}

@media (min-width: 768px) {
  :root {
    --layout-max-width: min(100% - 3rem, 52rem);
    --carousel-slide-max: 480px;
    --carousel-img-max-height: 540px;
    --hero-min-height: clamp(280px, 40vw, 540px);
  }

  .site-header,
  .hero,
  .cta-block,
  .portfolio,
  .site-footer,
  .footer-brand {
    max-width: var(--layout-max-width);
  }

  .hero__gradient {
    background: linear-gradient(
      to left,
      rgb(101, 9, 52) 0%,
      rgb(101, 9, 52) 10%,
      rgba(101, 9, 52, 0.9) 24%,
      rgba(101, 9, 52, 0.55) 44%,
      rgba(101, 9, 52, 0.2) 64%,
      rgba(101, 9, 52, 0) 100%
    );
  }

  .hero__copy {
    max-width: min(46%, 24rem);
    padding: 2.25rem 2rem 2.25rem 1rem;
  }

  .cta-block {
    padding-left: clamp(1.25rem, 4vw, 2rem);
    padding-right: clamp(1.25rem, 4vw, 2rem);
  }

  .portfolio {
    padding-left: clamp(1.25rem, 4vw, 2rem);
    padding-right: clamp(1.25rem, 4vw, 2rem);
  }

  .site-footer {
    padding-left: clamp(1.25rem, 4vw, 2rem);
    padding-right: clamp(1.25rem, 4vw, 2rem);
  }

  .footer-brand {
    padding-left: clamp(1.25rem, 4vw, 2rem);
    padding-right: clamp(1.25rem, 4vw, 2rem);
  }
}

@media (min-width: 1024px) {
  :root {
    --layout-max-width: min(100% - 4rem, 60rem);
    --carousel-slide-max: 520px;
    --carousel-img-max-height: 580px;
    --hero-min-height: clamp(300px, min(42vw, 36rem), 580px);
  }

  .site-header,
  .hero,
  .cta-block,
  .portfolio,
  .site-footer,
  .footer-brand {
    max-width: var(--layout-max-width);
  }

  .site-header {
    padding-left: clamp(1.25rem, 4vw, 2.5rem);
    padding-right: clamp(1.25rem, 4vw, 2.5rem);
  }

  .hero__copy {
    max-width: min(48%, 26rem);
    padding: 2.5rem 2.25rem 2.5rem 1.25rem;
  }

  .cta-block {
    padding-top: 5rem;
    padding-bottom: 3.5rem;
  }
}

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

  .btn--primary {
    transition: none;
  }

  .hero__photo {
    animation: none;
  }

  .hero__copy {
    animation: none;
  }

  .brand-logo,
  .brand-name,
  .tagline {
    animation: none;
  }

  .btn--primary:active {
    transform: none;
  }

  .site-footer.is-visible .contact-grid > * {
    animation: none;
  }

  .scroll-top {
    transition: opacity 0.15s ease;
    transform: none;
  }

  .scroll-top.is-visible {
    transform: none;
  }

  .scroll-top:hover,
  .scroll-top:active {
    transform: none;
  }
}
