/* ==========================================================================
   Detalle de proyecto (Framer "Project Single")
   Hero: título 100/104 con degradado (tablet 56, teléfono 36) + descripción.
   Imágenes 1.76:1 de radio 20 sobre marco con degradado; contexto 24/30 + 16/24;
   pastillas Urbanist 15px; grillas de 2 con gap 24; mockups de teléfono y navegador.
   ========================================================================== */

@layer sections {
  /* --- Hero --- */
  .project-hero {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1920px;
    margin-inline: auto;
    padding: 130px 12px 60px;
  }

  .project-hero__title {
    background: linear-gradient(151deg, var(--palette-white) 36%, var(--palette-dusty-gray) 136%);
    background-clip: text;
    color: transparent;
    font-size: 36px;
    font-weight: 400;
    line-height: 42px;
    letter-spacing: -1px;
  }

  .project-hero__text {
    max-width: 500px;
    color: var(--color-text-soft);
    font-size: 20px;
    font-weight: 500;
    line-height: 24px;
  }

  /* --- Imagen a ancho completo --- */
  .project-media {
    max-width: 1920px;
    margin-inline: auto;
    padding: 0 12px;
  }

  .project-media__image {
    width: 100%;
    height: 300px;
    border-radius: 16px;
    object-fit: cover;
  }

  /* --- Contexto --- */
  .project-context {
    display: flex;
    flex-direction: column;
    gap: 50px;
    max-width: 1920px;
    margin-inline: auto;
    padding: 40px 24px 24px;
  }

  .project-context--closing {
    padding: 80px 12px 120px;
  }

  .project-context__block {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1200px;
  }

  .project-context__title {
    color: var(--color-text-soft);
    font-size: 24px;
    font-weight: 500;
    line-height: 30px;
  }

  .project-context__text {
    color: var(--color-text-muted);
    font-size: 16px;
    line-height: 24px;
  }

  .project-context__points {
    display: flex;
    flex-direction: column;
    gap: 12px;

    li {
      display: flex;
      align-items: center;
      gap: 16px;
      color: var(--color-text-soft);
      font-size: 16px;
      line-height: 24px;
    }
  }

  .project-context__check {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 100px;
    background-color: var(--palette-dark-gray);
    color: var(--color-text-muted);

    svg {
      width: 14px;
      height: 14px;
    }
  }

  /* --- Secciones de galería --- */
  .project-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 1920px;
    margin-inline: auto;
    padding: 40px 24px;
  }

  .project-pill {
    align-self: flex-start;
    padding: 8px 22px;
    border: 1px solid rgb(255 255 255 / 10%);
    border-radius: var(--radius-pill);
    background-color: rgb(255 255 255 / 3%);
    color: var(--color-text);
    font-family: var(--font-alt);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .project-pill--link {
    letter-spacing: 0.02em;
    text-transform: none;
    background-color: rgb(255 255 255 / 4%);
    transition: border-color var(--duration) var(--ease-out), color var(--duration) var(--ease-out);

    &:hover {
      border-color: var(--color-accent);
      color: var(--color-accent);
    }
  }

  .project-tile {
    display: block;
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / 6%);
    border-radius: 16px;
    cursor: zoom-in;
  }

  .project-tile__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--ease-out);
  }

  .project-tile:hover .project-tile__image {
    transform: scale(1.02);
  }

  .project-tile--collage {
    height: 220px;
    border-color: rgb(255 255 255 / 8%);
  }

  .project-tile--collage-alt {
    height: 240px;
    border-color: rgb(255 255 255 / 8%);
  }

  .project-tile--half {
    height: 260px;
  }

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

  /* --- Redes sociales --- */
  .project-social__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    max-width: 1040px;
  }

  .project-social__content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: 1040px;
  }

  .project-social__posts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 200px;
    gap: 16px;
  }

  .project-tile--post {
    height: 100%;
    border-color: rgb(255 255 255 / 8%);
  }

  /* Reel en mockup de teléfono (380×770, radio 48) u horizontal 16:9 (radio 24) */
  .reel {
    position: relative;
    width: min(380px, 100%);
    aspect-ratio: 380 / 770;
    margin-inline: auto;
    overflow: hidden;
    border: 6px solid #222;
    border-radius: 48px;
    background-color: var(--palette-ink-black);
  }

  .reel--horizontal {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-lg);
  }

  .reel__media {
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
  }

  .reel__sound {
    position: absolute;
    right: 16px;
    bottom: 16px;
    padding: 8px 16px;
    border: 1px solid rgb(255 255 255 / 20%);
    border-radius: 999px;
    background-color: rgb(0 0 0 / 55%);
    backdrop-filter: blur(8px);
    color: var(--color-text);
    font-size: 13px;
    font-weight: 600;

    &[aria-pressed="true"] {
      border-color: var(--color-accent);
      color: var(--color-accent);
    }
  }

  /* --- Página web: mockup de navegador --- */
  .browser {
    display: flex;
    flex-direction: column;
    height: 320px;
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / 10%);
    border-radius: 20px;
    background-color: #0a0a0a;
  }

  .browser__bar {
    display: flex;
    flex: none;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 18px;
    border-bottom: 1px solid rgb(255 255 255 / 8%);
    background-color: #141414;
  }

  .browser__dot {
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color: #ff5f56;

    &:nth-child(2) {
      background-color: #ffbd2e;
    }

    &:nth-child(3) {
      background-color: #27c93f;
    }
  }

  .browser__url {
    margin-left: 12px;
    padding: 4px 14px;
    border-radius: 8px;
    background-color: rgb(255 255 255 / 5%);
    color: rgb(255 255 255 / 50%);
    font-family: var(--font-alt);
    font-size: 12px;
  }

  .browser__body {
    flex: 1;
    min-height: 0;
  }

  .browser__media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
  }

  /* --- Créditos --- */
  .project-credits {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 1920px;
    margin-inline: auto;
    padding: 24px 24px 40px;
    border-top: 1px solid rgb(255 255 255 / 8%);
  }

  .project-credits__text {
    color: rgb(255 255 255 / 50%);
    font-family: var(--font-alt);
    font-size: 14px;
  }

  .project-credits__brand {
    color: var(--color-accent);
    font-family: var(--font-alt);
    font-size: 14px;
    font-weight: 600;
  }

  /* --- Lightbox --- */
  .lightbox {
    max-width: 100vw;
    max-height: 100vh;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 24px;
    border: 0;
    background: rgb(0 0 0 / 92%);

    &[open] {
      display: flex;
      align-items: center;
      justify-content: center;
    }

    &::backdrop {
      background: transparent;
    }
  }

  .lightbox__image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    object-fit: contain;
  }

  .lightbox__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 100px;
    background-color: rgb(255 255 255 / 10%);
    color: var(--color-text);
    font-size: 28px;
    line-height: 1;
  }

  /* --- Tablet --- */
  @media (min-width: 810px) {
    .project-hero {
      padding: 110px 24px 100px;
    }

    .project-hero__title {
      font-size: 56px;
      line-height: 62px;
      letter-spacing: -2px;
    }

    .project-media {
      padding-inline: 24px;
    }

    .project-media__image {
      height: 500px;
      border-radius: 20px;
    }

    .project-context {
      padding: 50px 48px 32px;
    }

    .project-context--closing {
      padding: 80px 24px 120px;
    }

    .project-section {
      gap: 20px;
      padding: 40px 72px 60px;
    }

    .project-tile--collage {
      height: 480px;
      border-radius: 20px;
    }

    .project-tile--collage-alt {
      height: 380px;
      border-radius: 18px;
    }

    .project-tile--half {
      height: 380px;
    }

    .project-branding__grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 24px;
    }

    .project-social__posts {
      width: 580px;
      grid-auto-rows: 352px;
      gap: 20px;
    }

    .browser {
      height: 620px;
    }

    .project-credits {
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      padding: 40px 72px 60px;
    }
  }

  /* --- Desktop --- */
  @media (min-width: 1440px) {
    .project-hero {
      flex-direction: row;
      align-items: flex-end;
      gap: 0;
      padding: 129px 89px 120px 84px;
    }

    .project-hero__title {
      flex: 1;
      font-size: 100px;
      line-height: 104px;
      letter-spacing: -4px;
    }

    .project-hero__text {
      flex: 1;
      font-size: 24px;
      line-height: 24px;
    }

    .project-media__image {
      height: auto;
      aspect-ratio: 1.76;
    }

    .project-context {
      padding: 70px 72px 40px;
    }

    .project-context--closing {
      padding: 80px 75px 120px 72px;
    }

    .project-section {
      gap: 24px;
    }

    .project-tile--collage {
      height: 750px;
    }

    .project-tile--collage-alt {
      height: 800px;
    }

    .project-social__content {
      flex-direction: row;
      justify-content: center;
      gap: 40px;
    }

    .project-social__posts {
      width: 620px;
      grid-auto-rows: 375px;
    }

    .reel {
      flex: none;
      width: 380px;
      margin-inline: 0;
    }

    .reel--horizontal {
      flex: 1;
      width: auto;
    }
  }
}
